Question: Note a java class must be defined in a java file named same as the class name. Lab 4: Create a java file for class
Note a java class must be defined in a java file named same as the class name.
Lab 4: 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 two Rectangle objects (you specify the widths and heights) and display the areas of these two rectangles.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
