Question: .Java code: -Create a class to represent circle in java, the class should have the following fields: -A protected variable named Radius: a variable to
.Java code:
-Create a class to represent circle in java, the class should have the following fields: -A protected variable named Radius: a variable to hold the radius of a circle. -A static variable named shape: a variable to hold the type of a shape which is circle. -The class should have an instance method that prints out the value of the length of radius along with its perimeter. " perimeter of a circle = 2x radius x 3.14". -The class should have a class method that prints out the type of the shape.
In the main class, declare and instantiate 2 objects of the circle class.
-Set the variables values for both objects, and call the instance method that prints out the values and the perimeter of the circle. - Call the class method that prints out the type of the shape. - In the circle class, declare a static final variable named course: wich is a variable to hold the name of the course which is Math.
In the main class, try to change the value of the variable course.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
