publicstaticvoid main(String... args) { try { new Pos12().test();
} catch (A exception) { try { try { throw exception; // used to throw A, now throws Ab
} catch (Ac cException) { // This should NOT catch sibling exception Ab thrownew RuntimeException("FAIL: Should not be caught in catch Ac");
}
} catch (Ab | Ac bcException) { if (bcException instanceof Ac) { thrownew RuntimeException("FAIL: Sibling exception Ab not caught as expected");
} elseif (bcException instanceof Ab) {
System.out.println("PASS");
}
}
}
}
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.