NTU-OOP-Tuts-2025-1/T3Q2-1/src/Test.java

22 lines
1.1 KiB
Java

public class Test {
public static void main(String[] args) {
Circle testCircle1 = new Circle();
Circle testCircle2 = new Circle(2, 4, 35);
Cylinder testCylinder1 = new Cylinder();
Cylinder testCylinder2 = new Cylinder(3, 3, 8, 20);
System.out.println("Area of Circle 1 = " + testCircle1.area());
System.out.println("Area of Circle 2 = " + testCircle2.area());
System.out.println("Surface Area of Cylinder 1 = " + testCylinder1.area());
System.out.println("Surface Area of Cylinder 2 = " + testCylinder2.area());
System.out.println("Volume of Cylinder 1 = " + testCylinder1.volume());
System.out.println("Volume of Cylinder 2 = " + testCylinder2.volume());
System.out.println("Description of Circle 1 = " + testCircle1.toString());
System.out.println("Description of Circle 2 = " + testCircle2.toString());
System.out.println("Description of Cylinder 1 = " + testCylinder1.toString());
System.out.println("Description of Cylinder 2 = " + testCylinder2.toString());
}
}