Question: Write a main method in a new test application class, and in this main method create a Square Object ( from part ( b )

Write a main method in a new test application class, and in this
main method create a Square Object (from part (b)) with a length
of 5. Call the method that calculates the area of this Square and
print this value to the screen.
Also, in your main method, write code to do the following:
i. Create an array containing 7 Square objects allowing
each object have a length of 8 when it is created.
ii. Call the getter method on the 2nd object in the array of
Square objects and print this value to the screen.
iii. Set the length of the 4th object to be 3.2 and the 6th
object to be 8.6.
iv. Print out the area of each element (square object) of
the array

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!