Type the remote interface: extends Remote, every method throws RemoteException
Type the remote interface: extends Remote, every method throws RemoteException
Answer
import java.rmi.Remote; import java.rmi.RemoteException; public interface PrimeService extends Remote { long largestPrimeInRange(long low, long high) throws RemoteException; }
Remote is a marker with no methods — extending it is what makes the runtime build a stub for this type. The throws clause is mandatory on every method here, and it is what forces the client to handle a failed call.
JDK javadoc java.rmi.Remote; java.rmi.RemoteException