If you can use your own exception. then your own exception should extend java.lang.RuntimeException or a subclass of RuntimeException. RuntimeException is an exception without checking. In this case, you should use the exception without checking.
source
share