// user program of Rectangle class to demonstrate creating and using Rectangle objects // note the use of System.out.println(r2); which will invoke the Rectangle's toString method public class Prog9_1 { public static void main(String[] args) { Rectangle r1 = new Rectangle(4, 40); Rectangle r2 = new Rectangle(3.5, 35.9); System.out.println(r1.getHeight()); System.out.println(r1.getWidth()); System.out.println(r1.getArea()); System.out.println(r1.getPerimeter()); System.out.println(r2); } }