⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 computerfactory.java

📁 《深入浅出设计模式》的完整源代码
💻 JAVA
字号:
package computerworld;
//定义抽象电脑工厂类
public abstract class ComputerFactory {
  CPU cpu;
  HardDisk hd;
  MainBoard mb;
  public void show () {
    try {
      System.out.println (this.getClass ().getName ().toString () + "生产的电脑配置");
      System.out.println ("CPU:" + cpu.getCPU ());
      System.out.println ("HardDisk:" + hd.getSize ());
      System.out.print ("MainBoard:");
      mb.Attach (cpu);
    }
    catch (Exception e) {
      System.err.println (e.getMessage ());
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -