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...


write code in java



Q#2: Create a class named

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.
Q#1: Create a class named

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.

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here