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

📄 spooler.java

📁 正在学习Java的人或许能从中得到自己想要的东西
💻 JAVA
字号:
public class Spooler {
    //this is a prototype for a printer-spooler class
    //such that only one instance can ever exist
    static boolean instance_flag = false; //true if one instance

    public Spooler() throws SingletonException
    {
        if (instance_flag)
            throw new SingletonException("Only one printer allowed");
        else
            instance_flag=true;     //set flag for one instance
        System.out.println("printer opened");
    }
}                                                        

⌨️ 快捷键说明

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