Ask Question
4 June, 21:13

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:

+2
Answers (1)
  1. 5 June, 01:00
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers