/* * File: Rectangle.java * Author: Java, Java, Java * Description: This program represents a geometric rectangle. * This class is not runnable, because it does not have a main() method. */ public class Rectangle { private double length; // Instance variables private double width; public Rectangle(double l, double w) // Constructor method { length = l; width = w; } // Rectangle() constructor public double calculateArea() // Access method { return length * width; } // calculateArea() public static void main(String args[]) { //create a rectangle with length of 10 and width of 5 Rectangle rectangle1 = new Rectangle(10, 5); //print out the area size of rectangle1 System.out.println("The area of rectangle1 is " + rectangle1.calculateArea() ); } } // Rectangle