The next server job is to create an initial instance of the server object and then write a name for the object into the RMI name registry. The RMI name registry lets you assign URL names to objects so that clients can look them up To register the name, call the static rebind method, which is defined on the Naming class. This method accepts the URL name for the object and the object reference.
The name string is the interesting part. It contains the rmi:// prefix, the hostname of the computer where the RMI object's server runs, and the object's name itself, which is pretty much whatever you want. Note that instead of hard-coding the hostname as we did here, you can call the getLocalHost method defined by the java.net.InetAddress class.