package factoryMethod; public abstract class ComputerCreator { protected Comp comp; public ComputerCreator() { super(); } public Comp Create() { comp = new Comp(); comp.setProc(GetProcessor()); comp.setKeys(GetKeyBoard()); comp.setScreen(GetMonitor()); // and so on... return comp; } // Factory Methods } public Processor GetProcessor() { return new Processor(1500, 300); } public KeyBoard GetKeyBoard() { return new KeyBoard(102); } // and so on.... }