1 7 package discRack.spec; 8 9 public class DiscFactory { 10 13 private DiscFactory() { 14 } 15 18 public static Disc getDisc(String fullClassName) throws DiscRackException 19 { 20 Disc result=null; 21 Class objectClass = null; 22 23 try{ 24 objectClass = Class.forName(fullClassName); 26 27 result = (Disc)objectClass.newInstance(); 28 29 30 } catch (Exception ex) { 31 System.out.println("Error on creating the object" + ex); 32 } 33 34 return result; 35 36 } 37 38 } | Popular Tags |