olve this with java ??? Create a class named “Circle” having radius as attribute. There should be behavior to set the value of radius and to get the value of radius, diameter, circumference and area of the circle. Create another class named as Main which have two objects of Circle (c1, c2) having radius 3 and 4.5 respectively. Also display the radius, diameter, circumference and area of both circles. Note: Main class should not access the attributes of the Circle class. 2: Create a class named “Rectangle” having length and width as attribute. There should be behaviors to set the values of length and width (individually and collectively), and get their values individually. There should also behavior to display the perimeters and area of the rectangle. Create another class named as Main which have two objects of Rectangle (r1, r2) having length (3.2, 20) and width (4.5, 36) respectively. Also display the length, width, perimeter and area of both rectan
solve this with java ???
Create a class named “Circle” having radius as attribute. There should be behavior to set the value of radius and to get the value of radius, diameter, circumference and area of the circle. Create another class named as Main which have two objects of Circle (c1, c2) having radius 3 and 4.5 respectively. Also display the radius, diameter, circumference and area of both circles.
Note: Main class should not access the attributes of the Circle class.
2: Create a class named “Rectangle” having length and width as attribute. There should be behaviors to set the values of length and width (individually and collectively), and get their values individually. There should also behavior to display the perimeters and area of the rectangle.
Create another class named as Main which have two objects of Rectangle (r1, r2) having length (3.2, 20) and width (4.5, 36) respectively. Also display the length, width, perimeter and area of both rectangles.
Step by step
Solved in 3 steps with 7 images