外观模式期末

public class OS {

    public void load(){

        System.out.println("操作系统载入。。。。。");

    }

}
public class Memory {

    public void check() {

        System.out.println("内存自检。。。。。");

    }


}
public class HardDisk {

    public void read(){

        System.out.println("硬盘读取。。。。。");

    }

}
public class CPU {

    public void run(){

        System.out.println("CPU运行。。。。。");

    }

}
public class Mainframe {

    public Memory memory  = new Memory();

    private CPU cpu = new CPU();

    private HardDisk hardDisk = new HardDisk();

    private OS os = new OS();



    public void on(){

        memory.check();

        cpu.run();

        hardDisk.read();

        os.load();

    }



}
public class Client {

    public static void main(String[] args) {

        System.out.println("软件设计模式实验||外观模式||软件2014班||延月刚||2020007218");


        Mainframe mainframe = new Mainframe();


        mainframe.on();

    }

}

你可能感兴趣的:(期末,外观模式,java,开发语言)