You are on page 1of 4

OUTPUT FOR RMI

Se

Cl

Program:

Client:
import java.rmi.*; public class SmallClient { public static void main(String[] args) { try { SmallInter sm=(SmallInter)Naming.lookup("small"); S stem.out.println(sm.get!sg("Client")); " catch (#$%eption e) { e.printSta%k&ra%e(); " " " import java.rmi.*; public interface SmallInter extends 'emote { public String get!sg(String s)throws 'emote#$%eption; "

Server:
import java.rmi.*; import java.rmi.server.*; public class SmallServer extends (ni%ast'emote)*je%t implements SmallInter { String str=null; public SmallServer() throws 'emote#$%eption {" public String get!sg(String s) throws 'emote#$%eption { try { str="&+is is t+e msg ,rom server *e,ore t+e msg ,rom"-s; " catch (#$%eption e) {

e.printSta%k&ra%e(); " return str; " public static void main(String[] args) { try { SmallServer sm=new SmallServer(); Naming.re*in.("small"/sm); S stem.out.println("'ea."); " catch (#$%eption e) { e.printSta%k&ra%e(); " " "

You might also like