//This is addServer that is responsible for add two integer numbers import java.net.*; import java.rmi.*; import java.rmi.server.UnicastRemoteObject; public class addServerImpl extends UnicastRemoteObject implements addInterface{ String newLine = System.getProperty("line.separator"); public addServerImpl() throws RemoteException{ System.out.println("Initializing addserver"); } public static void main(String arg[]){ System.setSecurityManager(new RMISecurityManager()); try{ addServerImpl ASI=new addServerImpl(); Naming.rebind("addserver", ASI); System.out.println("registered with Registry"); } catch (RemoteException e){ System.out.println("I catch RemoteExceptiom Error: " + e); } catch (java.net.MalformedURLException e){ System.out.println("URL Error:" + e); } } public String add(int a, int b){ return ("The add method is invoked in add server"+ newLine+a+"+"+b+" = "+(a+b)+newLine+newLine); } }