rmiexampleserver.java

来自「java核心编程的部分源码」· Java 代码 · 共 27 行

JAVA
27
字号
 import java.rmi.*;
import java.rmi.server.*;

/**
* This class is a simple example of a RMI Server
* @author Renga
**/
public class RMIExampleServer extends UnicastRemoteObject
implements RMIExample {

/**
* Do nothing constructor
* @throws RemoteException
**/
public RMIExampleServer() throws RemoteException {
System.out.println( "RMIExampleServer::cntr" );
}

/**
* Returns "Hello World from RMI!"
* @return A string
* @throws RemoteException
**/
public String sayHello() throws RemoteException {
return "Hello World from RMI!";
}
} 

⌨️ 快捷键说明

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