Question: Make TestRectangle class having main method to test Rectangle class & do the following things: create first object of Rectangle using default constructor and display
Make TestRectangle class having main method to test Rectangle class & do the following things:
create first object of Rectangle using default constructor and display the value of length and width variables of the Rectangle class
create second object of Rectangle using constructor with values and and display the value of length and width variables of the Rectangle class
invoke setLength method using first object which you have created above and change value of length variable of Rectangle class to
invoke setWidth method using first object which you have created above and change value of width variable of Rectangle class to
print the value of first object using println method
declare an array of type Rectangle class of size and load it using a loop and invoking a constructor with two arguments
using a loop print the content of above array which you have loaded already
create third and fourth objects of Rectangle class and compare them using equals method.
javadoc documentation for both classes into one index.html file
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
