public class RectanglePoly { public static void main(String args[]){ // This alias can point to all Rectangles and its sub classes Rectangle r; if(args[0].equals("rectangle")){ r = new Rectangle(20, 10); }else{ r = new Parallelogram3(20, 10, 1); } r.printDetails(); } }