public class HelloServer extends UnicastRemoteObject implements HelloInterface { public HelloServer() throws RemoteException { super(); }
public String sayHello() throws RemoteException { return "Hello world , the current system time is " + new Date(); } }
//HelloClient.java
import java.rmi.*;
public class HelloClient { public static void main(String args[]) { if(System.getSecurityManager() == null) System.setSecurityManager(new RMISecurityManager());