Question: use java Update the circle class definition. You need to: Add a copy constructor to the class Circle. Add a public method setRadius (double r)

 use java Update the circle class definition. You need to: Add

use java

Update the circle class definition. You need to: Add a copy constructor to the class Circle. Add a public method setRadius (double r) Add a public method double getRadius () Create circle2 as a clone of circle in the main (). Display its circumference and area. Use setRadius (..) to change radius of circle. Does it affect circle2? Prove your answer by displaying relevant values. Declare another object reference variable Circle circle3 = circle2; Display the radius of circle2 and circle3. Are these values the same? Change the radius of circle3 to a different value. Display the radius of circle2 and circle3 again. As the radius of circle2 has not been changed, it should be different from the radius of circle3 that has been changed. Are they different? Explain the result

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!