Why NullPointerException is a runtime exception and RemoteException not?

Posted by Tom Brito on Stack Overflow See other posts from Stack Overflow or by Tom Brito
Published on 2010-05-21T19:07:47Z Indexed on 2010/05/21 19:10 UTC
Read the original article Hit count: 220

Filed under:
|
|

A possible reason because a NullPointerException is a runtime exception is because every method can throw it, so every method would need to have a "throws NullPointerException", and would be ugly. But this happens with RemoteException.

And a possible reason because RemoteException is not a runtime exception, is to tell it client to treat the exception. But every method in a remote environment need throws it, so there is no difference of throwing NullPointerException.

Speculations? Was I clear?

© Stack Overflow or respective owner

Related posts about java

Related posts about exception