001package factory.shape5.main; 002import factory.shape5.Shape; 003import factory.shape5.ShapeFactory; 004public class Main { 005 public static void main (String[] args) 006 throws ClassNotFoundException 007 { 008 ShapeFactory.addShape("Triangle", "shape.main.Triangle"); 009 Shape[] a = new Shape[3]; 010 a[0] = ShapeFactory.newShape("Circle"); 011 a[1] = ShapeFactory.newShape("Square"); 012 a[2] = ShapeFactory.newShape("Triangle"); 013 System.out.println(a[0]); 014 System.out.println(a[1]); 015 System.out.println(a[2]); 016 } 017}