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

📄 helloworldrmiserver2.java

📁 21天学通java的示例程序源代码
💻 JAVA
字号:
// HelloWorldRMIServer2.java

import java.rmi.*;
import javax.naming.*;

public class HelloWorldRMIServer2 {
  public static void main(String[] args) {
    try {
      System.out.println("Creating implementation object");
      HelloWorld2 impl = new HelloWorldRMIImpl2();

      Context initialNamingContext = new InitialContext();

      String objName = "/HelloWorldRMI2";
      System.out.println("Connecting to Naming Service");
      System.out.println("Binding object to naming context " 
                         + "with name '" + objName + "'");
      initialNamingContext.rebind(objName, impl);

      System.out.println("Ready to accept RMI-IIOP requests");
    } catch (Exception e) {
      System.out.println("Exception : " + e);
      e.printStackTrace(System.out);
    } 
  } 
}

⌨️ 快捷键说明

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