Question: Create a class called Circle that has two attributes, one is a constant private PI which is 3.14 and the other one is Radius. The

Create a class called Circle that has two attributes, one is a constant private PI which is 3.14 and the other one is Radius. The class should have a constructor that sets the Radius for any objects created. The class should also have a public method called calculateArea() which calculates the area and returns it. - Write a test program to define a myCircle of type Cirlce (the above class) and show the area of the circle in the output using the calculateArea() method.

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!