Client Program: addclient.java
import java.rmi.*;
import java.lang.*;
public class addclient
{
public static void main(String args[])
{
try
{
String addserverurl="rmi://"+args[0]+"/addserver";
addserverintf addserverintf=
(addserverintf)Naming.lookup(addserverurl);
System.out.println("The first number is "+args[1]);
System.out.println("The second number is "+args[2]);
double d1=Double.parseDouble(args[1]);
double d2=Double.parseDouble(args[2]);
System.out.println("The sum of two
numbers="+addserverintf.add(d1,d2));
System.out.println("The difference between two
numbers="+addserverintf.subtract(d1,d2));
System.out.println("The product of two
numbers="+addserverintf.multiply(d1,d2));
System.out.println("The result of
division="+addserverintf.devide(d1,d2));
}
catch(Exception e)
{
System.out.println(e);
}
}
}
Interface implementation file: addserverimpl.java << Previous
Next >>Server Program: addserver.java
Our aim is to provide information to the knowledge seekers.