Question: Write a Java statement to initialize a variable square with a rectangle object whose top-left corner is (10, 20) and whose sides all have length
Write a Java statement to initialize a variable square with a rectangle object whose top-left corner is (10, 20) and whose sides all have length 40. Then write a statement that replaces square with a rectangle of the same size and top-left corner (20, 20).
Step by Step Solution
3.37 Rating (153 Votes )
There are 3 Steps involved in it
In Java we can use the Rectangle class from the javaawt package to represent rectangles If were assu... View full answer
Get step-by-step solutions from verified subject matter experts
