//This is subtract Server that is responsible for subtract two integer numbers import java.net.*; import java.rmi.*; import java.rmi.server.UnicastRemoteObject; public class subtractServerImpl extends UnicastRemoteObject implements subtractInterface{ String newLine = System.getProperty("line.separator"); public subtractServerImpl() throws RemoteException{ System.out.println("Initializing subtractServer"); } public static void main(String arg[]){ System.setSecurityManager(new RMISecurityManager()); try{ subtractServerImpl SSI=new subtractServerImpl(); Naming.rebind("subtractserver", SSI); 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 subtract(int a, int b){ return ("The subtract method is invoked in subtract server"+ newLine+a+"-"+b+" = "+(a-b)+newLine+newLine); } }