I want to understand what is the use of extending marker interafce java.rmi.Remote ........i read that its to inform JVM that methods of this interface can be called remotely.........if this is the case then why should i extend UnicastRemoteObject(which actually extends RemoteObject) in implementing class ??? in my implementation class , it should just work by implementing the remote interface ......??
UnicastRemoteObject is used to export your object and make it available for remote invocations. You may well choose not to extend UnicastRemoteObject, instead use UnicastRemoteObject.export()to export your object explicitly. If you extend UnicastRemoteObject, you do not need to explicitly export the object, it is done implicitly when you create an instance of the object. (Wondered why the constructor throws a RemoteException!!!)