Assertions and Java Exceptions


•       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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.