0% found this document useful (0 votes)
24 views1 page

Test Rectangle

Uploaded by

Mr. X
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

Test Rectangle

Uploaded by

Mr. X
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

public class TestRectangle{

public static void main(String[] args){


Rectangle rectangle1 = new Rectangle();
Rectangle rectangle2 = new Rectangle(5,5);

System.out.println("Area of Rectangle is " + rectangle1.getArea());


System.out.println("Perimeter of Rectangle is " +
rectangle1.getPerimeter());
System.out.println("Draw of Rectangle");
rectangle1.drawRect();
System.out.println();

System.out.println("Area of Rectangle is " + rectangle2.getArea());


System.out.println("Perimeter of Rectangle is " +
rectangle2.getPerimeter());
System.out.println("Draw of Rectangle");
rectangle2.drawRect();
}
}

You might also like