Images

3

Assertions and Java Exceptions

CERTIFICATION OBJECTIVES

•       Use try-catch and throw Statements

•       Use catch, Multi-catch, and finally Clauses

•       Use Autoclose Resources with a try-with-resources Statement

•       Create Custom Exceptions and Auto-closeable Resources

•       Test Invariants by Using Assertions

Images     Two-Minute Drill

Q&A   Self Test

The assertion mechanism gives you a way to do testing and debugging checks on conditions you expect to smoke out while developing, when you don’t want the runtime overhead associated with ...

Get OCP Java SE 8 Programmer II Exam Guide (Exam 1Z0-809), 7th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.