assylias explain well about final rethrow.
I added final to method3
.
public void method4() throws IOException {
try {
throw new IOException("1");
} catch (final Exception e) {
e = new IOException("2"); //does not compile
throw e; //does not compile
}
}
I set my compiler to 1.7. method4
have two compile errors :
final exception can neither be reassigned nor throw precise exception.
So, explicit final exception is only used to prevent modify?