Ask Question

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. 25 June, 19:28
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers