I`m trying to use sets and gets for a code, but it`s not compiling
I`m not sure how to set and get a String,
this is what I have so far
this is class Car
String color;
void setColor(String col)
{
color = col;
}
String getColor()
{
return color;
}
This compiles, but when I call it in my testCar class I get an error
This is class testCar
Car myCar = new Car();
myCar.setColor = "Red";
I`m having an error in my class testCar, when setting the color
Thanks guys