Objects inserted in sets must override the
equals method. In the case of a hash set or hash map, the
hashCode method must be defined as well. However, there is a problem when trying to compare remote objects. To find out if two remote objects have the same contents, the call to
equals would need to contact the servers containing the objects and compare their contents. Like any remote call, that call could fail. But the
equals method in the class
Object is not declared to throw a
RemoteException, whereas all methods in a remote interface must throw that exception. Since a subclass method cannot throw more exceptions than the superclass method it replaces, you cannot define an ...