Submitted by Karthikeyan on

AddClient.java


import java.rmi.*;
public class AddClient {
    public static void main(String a[]) {
        try {
            String addserverURL="rmi://"+a[0]+"/AddServer";AddServerInf addServInf=(AddServerInf)Naming.lookup(addserverURL);
            System.out.println("The first number is "+a[1]);
            double d1 = Double.valueOf(a[1]).doubleValue();
            System.out.println("The second number is "+a[2]);
            double d2 = Double.valueOf(a[2]).doubleValue();
            System.out.println("The sum is "+addServInf.add(d1,d2));
        } catch(Exception e) {
            System.out.println("Exception: "+e.getMessage());
        }
    }
}