/** * A simple test of Factory methods. * * @author Samuel A. Rebelsky * @version 1.0 of December 2004 */ public class FactoryMethod { public void dostuff() { for (int i = 0; i < 4; i++) { Object o = create(i); System.out.println(o.getClass() + ": " + o); } } public Object create(int i) { return Integer.toString(i); } // create(int) } // class FactoryMethod