~/ learn/ comp-348/ cards/ The remote interface and its implementation
1 of 5

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

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/37389107-0de0-422f-b4fb-fc81a884f35b/flashcard utf-8 LF