assylias erklären gut über final rethrow. Ich fügte das Finale zu method3
hinzu.Präzise Wiederholung Ausnahme in Java7
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
}
}
Ich legte meinen Compiler auf 1.7. haben zwei Kompilierung Fehler:
final exception can neither be reassigned nor throw precise exception.
So explizite letzte Ausnahme wird nur ändern, um zu verhindern verwendet?