write code in java
Extracted text: Q#2: Create a class named "Rectangle" having length and width as attribute. There should be behaviorstoset 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 (rl, r2) having length (3.2, 20) and width (4.5, 36) respectively. Also displaythe length, width, perimeter and area of both rectangles.Extracted text: Q#1: 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 areaof the circle. Create another class named as Main which have two objects of Circle (cl, c2) having radius 3 and 4.5 respectively. Also displaythe radius, diameter, circumference and area of both circles. Note: Main class should not access the attributes of the Circle class.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here