正在学习Java的人或许能从中得到自己想要的东西

源代码在线查看: singlespooler.java

软件大小: 11996 K
上传用户: xukejia
关键词: Java
下载地址: 免注册下载 普通下载 VIP

相关代码

				public class singleSpooler
				{
				   static public void main(String argv[])
				   {
				      Spooler pr1, pr2;
				      //open one printer--this should always work
				      System.out.println("Opening one spooler");
				      try{
				      pr1 = new Spooler();
				      }
				      catch (SingletonException e)
				      {System.out.println(e.getMessage());}
				      //try to open another printer --should fail
				      System.out.println("Opening two spoolers");
				      try{
				      pr2 = new Spooler();
				      }
				      catch (SingletonException e)
				      {System.out.println(e.getMessage());}
				   }
				}
				
							

相关资源