Question: thanks in advance! Circle and CircleTester: Write the Java code for a Circle class which matches the following description. Your class should have the following
Circle and CircleTester: Write the Java code for a Circle class which matches the following description. Your class should have the following instance variable radius. A double The Circle class should have the following methods Constructor which has no arguments. It should initialize the radius to 0 2nd Constructor which accepts the radius of the circle as an argument There should be TWO constructors. setRadius. A mutator method for the radius field getRadius. An accessor method for the radius field getArea. Returns the area of the circle, which is calculated as area = Pl* radius radius get Diameter. Returns the diameter of the circle, which is calculated as diameter = radius. 2 getCircumference. Returns the circumference of the circle which is calculated as circumference = 2 PI * radius public String toString() This method should display the circle's radius, diameter, area, and circumference in a nice format NOTE: There should not be a main method in this class! Write the Java code for a CircleTester class which matches the following description: Create four Circle objects, each with a different radius SOP the contents of the objects Change the radius on the first object you created. Then, SOP again
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
