You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
665 B

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. public class TestShape
  2. {
  3. public static void main(String[] args)
  4. {
  5. Circle c1 = new Circle(2.67);
  6. System.out.println("c1: ");
  7. System.out.println(c1.toString());
  8. System.out.println();
  9. Circle c2 = new Circle(3, false, "Red");
  10. System.out.println("c2: ");
  11. System.out.println(c2.toString());
  12. System.out.println();
  13. Rectangle r1 = new Rectangle(3, 2, true, "Blue");
  14. System.out.println("r1: ");
  15. System.out.println(r1.toString());
  16. System.out.println();
  17. Rectangle r2 = new Rectangle(3.2, 4, false, "Red");
  18. System.out.println("r2: ");
  19. System.out.println(r2.toString());
  20. }
  21. }