Question: JAVA LANGUAGE Create a Circle class, with two private properties - radius and colour. Create a Main class, that will be used to instantiate and

JAVA LANGUAGE JAVA LANGUAGE Create a Circle class, with two private properties -

Create a Circle class, with two private properties - radius and colour. Create a Main class, that will be used to instantiate and interact with your Circle class. In the Circle class, add a default constructor (no params) that will always create a green circle with a radius of 2 . Add a second overloaded constructor, which allows external classes to control the size of any new circle object. Add a third constructor, which allows the creation of circles of any size or color on object creation. Add getter methods for the two properties (this makes them read-only from outside) Add a getArea method to calculate and return the total area of a circle object. Math.PI may be useful here... Add a toString() method that will return a description of a circle object, something like "Radius =2, Colour = Blue" In the Main class' PSVM method, write a program to create at least three circle objects (testing each constructor) and interact with the other class methods. Remember: No console printing should be done from within your Circle class

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!