I have this snippet.
public final class StackOverflow{
class MyException extends Throwable{
}
private void a(){
try{
}catch(MyExceptio
Exception extends from RuntimeException
will considered as uncheched exception, so it's ok:
class MyException extends RuntimeException { }
try {
...
} catch (MyException e) {
}
Your exception extends from Throwable
, so it is cheched exception. Since the compiler noticed that it is never thrown, so the compile fails.