publicclass Main { staticpublicvoid main(String[] args) throws Exception { try {
check(false);
} catch (Throwable t) { // Should catch the NoClassDefFoundError
System.out.println("Caught " + t.getClass());
}
}
privatestaticvoid check(boolean b) { try { if (b) { // Need this to not be dead code, but also not be invoked.
throwsTestException(); // TestException is checked, so we need something potentially // throwing it.
} thrownew RuntimeException(); // Trigger exception handling.
} catch (TestException e) { // This handler will have an unresolvable class.
} catch (Exception e) { // General-purpose handler
System.out.println("Got expected exception.");
}
}
// This avoids having to construct one explicitly, which won't work. privatestaticnativevoid throwsTestException() throws TestException;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.