Question: 1- Create a class to represent a rectangle type in java, the class should have the following fields: - Length: variable to hold the length

 1- Create a class to represent a rectangle type in java,

1- Create a class to represent a rectangle type in java, the class should have the following fields: - Length: variable to hold the length of a rectangle. - Width. : variable to hold the width of a rectangle. 2- The class should have a method that prints out the values of the width and length of a rectangle along with its area. "area of rectangle= width x length". 3- In the main class, declare and instantiate 2 objects of the rectangle class. 4- Set the variables' values for both objects and call that prints out the values and the area of the rectangle

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!