// Server side registration. ExampleImpl obj = new ExampleImpl (); Naming.rebind ("//localhost/Example", obj); // Client side lookup. Example obj = (Example) Naming.lookup ("//localhost/Example"); obj.printMessage ("Hello World !");