/**a
   This program passes an object as an argument which really
	means it's passing the address of the object or a pointer
	to the object to the method displayRectangle
	
	@author: Tony Gaddis modified by Elizabeth adams
	@version: 1.1 - 9/18/08
*/

public class PassObject
{
   public static void main(String[] args)
   {
      // Declare a Rectangle object.      
      Rectangle box; 
		
		 // instantiate the Rectangle object
		box = new Rectangle(12.0, 5.0);

      // Pass a reference to the object to
      // the displayRectangle method.      
      displayRectangle(box);
   }

   /**
      The displayRectangle method displays the
      length and width of a rectangle.
		
      @param r has a reference to a Rectangle
      object.
   */

   public static void displayRectangle(Rectangle r)
   {
      // Display the length and width.
      System.out.println("Length : " + r.getLength() +
                         " Width : " + r.getWidth());
   }
}
