Write a program called FourRectanglePrinter that constructs a Rectangle object, prints its location by calling System.out.println(box), and then translates and prints it three more times, so that, if the rectangles were drawn, they would form one large rectangle:

Respuesta :

C:\java>javac FourRectanglePrinter.java
FourRectanglePrinter.java:11: incompatible types
found : void
required: java.awt.Rectangle
Rectangle box1 = box.translate(0,30);
- ^
FourRectanglePrinter.java:14: incompatible types
found : void
required: java.awt.Rectangle
Rectangle box2 = box.translate(40,0);
- ^
FourRectanglePrinter.java:17: incompatible types
found : void
required: java.awt.Rectangle
Rectangle box3 = box.translate(40,30);
ACCESS MORE