Question: Exercise 1 1- Create a class to represent a circle type in java, the class should have the following fields: - id: a variable to

 Exercise 1 1- Create a class to represent a circle type

Exercise 1 1- Create a class to represent a circle type in java, the class should have the following fields: - id: a variable to hold the ID of a circle. -colour, a variable to hold the colour of a circle -radius: variable to hold the radius of a rectangle. - diameter : variable to hold the diameter of a rectangle. - area : variable to hold the area of a rectangle. 2- The Class has one constructor with three parameters(id, colours, and radius). 3- The class should have a calculation method that calculates the values of the diameter and area of the circle. diameter = 2* radius: area = 3.14" radius radius): 4- The class should have a class method that prints out the circle values. 5- In the main class, declare and instantiate 2 objects of the circle class. 6- Set the variables' values for both objects and call the calculation method, then call the print method to print out the values of the circle

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!