public class Rectangle{
public static void main (String[]args){
Rectangle1 rectangle = new Rectangle1();
rectangle.setColor ("white");
rectangle.setHeight(1);
rectangle.setWidth(1);
System.out.println(rectangle.toString());
}
}
class Rectangle1 {
private String color = "red";
private double height = 40;
private double width = 4;
Rectangle1 () {
}
public double getHeight(){
return height;
}
public double getWidth(){
return width;
}
public String getColor(){
return color;
}
//area and perimeter
double getArea(){
return height* width;
}
double getPerimeter(){
return height*2 + width*2;
}
public String toString(){
return System.out.println("the area is" + area + "the perimeter is" + perimeter + "\n"
+ "color is" + color);
}
}
having a problem with the cannot find symbol area for the set commands. any ideas?