Question: Note a java class must be defined in a java file named same as the class name. Create a java file for class Rectangle with
Note a java class must be defined in a java file named same as the class name.
Create a java file for class Rectangle with data members width and height, and member method getArea() and constructors, and save it as Rectangle.java. Then create another java file with main program to create an array with 5 Rectangle objects. And design a printRectangleArray method to display width, height, and area information of Rectangle objects in the array.
using Netbeans software
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
