You are on page 1of 3

DISTRIBUTED OBJECT DEPLOYMENT RMI DATE

AND TIME

SOURCE CODE:
INTER1.JAVA:
import java.rmi.*;

public interface inter1 extends Remote

public String show() throws RemoteException;

SERVER1.JAVA:
import java.rmi.*;

import java.rmi.server.*;

import java.util.*;

public class server1 extends UnicastRemoteObject implements inter

Date d;

public server() throws Exception{};

public String show() throws RemoteException

d=new Date();
String a=d.toString();

return a;

public static void main(String args[])throws Exception

server s=new server();

System.out.println("wait");

Naming.rebind("test",s);

System.out.println("server ready");

}
CLIENT1.JAVA:
import java.rmi.*;

class client

public static void main(String args[]) throws Exception

inter i=(inter)Naming.lookup("test");

String d=i.show();

System.out.println(d);

You might also like