class Two { public static void main(String[] args) { Shape[] a = new Shape[2]; a[0] = new Circle(0.5); a[1] = new Rectangle(12, 30); for (int i = 0; i < a.length; i++) System.out.println(a[i].area()); } } interface Shape { double area(); } class Circle implements Shape { double radius; Circle(double radius) { this.radius = radius; } public double area() { return Math.PI * Math.pow(this.radius, 2); } } class Rectangle implements Shape { double width, height; Rectangle(double width, double height) { this.width = width; this.height = height; } public double area() { return this.height * this.width; } } class One { public static void main(String[] args) { for (int i = 0; i < args.length; i = i + 1) { System.out.println(args[i]); } } }