Overriding the Default Ports 

        import java.rmi.Naming;
        import java.rmi.RemoteException;

        public class HelloClient {

            public static void main(String arg[]) {

                String message = "blank";
                Hello obj = null;

                try {
                    obj = (Hello) Naming.lookup("rmi://" +
                          "lysander.cs.ucsb.edu:21001" +
                          "/HelloServer");
                    System.out.println(obj.sayHello());
                } catch (Exception e) {
                    System.out.println("HelloClient exception: " + e.getMessage());
                    e.printStackTrace();
                }
            }
        }