Java经典例程 从外国一大学计算机教授出版物下载的代码 经典

源代码在线查看: magicnumberserver.java

软件大小: 542 K
上传用户: focuslocus
关键词: Java 大学 代码
下载地址: 免注册下载 普通下载 VIP

相关代码

				import java.rmi.*;
				
				public class MagicNumberServer {
				
				  /* The Magic Number client-server system    by J M Bishop  Aug 2000
				   * =====================================
				   *                            adapted from the ThingServer Oct 1997
				   *
				   * Illustrates client-server using RMI
				   * Run by typing:
				   * In Window 2:
				   *   java MagicNumberServer
				   */
				
				  public static void main (String args []) throws RemoteException {
				
				    MagicNumber number = new MagicNumber ();
				
				    try {
				      Naming.rebind ("Magic Number Service", number);
				    }
				    catch (Exception x) {
				      System.out.println("Could not bind or no such host etc"+x);
				    }
				    System.out.println("The Magic number service is running");
				  }
				}
				
							

相关资源