Ask Question
15 July, 06:45

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:

+4
Answers (1)
  1. 15 July, 08:37
    0
    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);
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a program called FourRectanglePrinter that constructs a Rectangle object, prints its location by calling System. out. println (box), ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers