Question: 1. The following Java class is a good example of a ______ OODP. class ComputerComposite { private CPU processor; private Memory ram; private HardDrive hd;
1. The following Java class is a good example of a ______ OODP. class ComputerComposite { private CPU processor; private Memory ram; private HardDrive hd; public ComputerComposite() { this.processor = new CPU(); this.ram = new Memory(); this.hd = new HardDrive(); } public void start() { processor.freeze(); ram.load(BOOT_ADDRESS, hd.read(BOOT_SECTOR, SECTOR_SIZE)); processor.jump(BOOT_ADDRESS); processor.execute(); } } /* Client */ class You { public static void main(String[] args) { ComputerComposite computer = new ComputerComposite (); computer.start(); } }
Bridge, Flyweight ,Singleton, Composite, Facade, Prototype
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
