Question: Write a Java program to develop a class Circle with the following specifications Write a Java program to develop a class Circle with the following

Write a Java program to develop a class Circle with the following specifications

Write a Java program to develop a class Circle with the following

Write a Java program to develop a class Circle with the following specifications 1. The class has one private attribute: radius, of type double 2. The class has one-argument constructor that sets the value of its instance variable to given value 3. The class has a zero-argument constructor that sets the value of its instance variable to its default values. It should invoke the one-argument constructor. 4. The class has public accessor and mutator methods for its attribute. 5.The class has a public method getArea () that takes no argument and returns area of circle. Note that the area of the circle radius* * PI . Where PI= 314 . 6. The class has a public method getPerimeter that takes no argument and returns 7. Override the Object's toString ) method in order to return a string representation the perimeter of the circle. Hint: Perimeter of the circle-2*PI*r of the Circle status as: Radius , area , perimeter

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!