7

Assertions and Java 7 Exceptions

CERTIFICATION OBJECTIVE

    •    Test Invariants by Using Assertions

    •    Develop Code That Handles Multiple Exception Types in a Single catch Block

    •    Develop Code That Uses try-with-resources Statements (Including Using Classes That Implement the AutoCloseable Interface)

    image  Two-Minute Drill

Q&A Self Test

If you are coming back after having sat the OCA, congratulations! You are now ready to progress to the OCP. The assertion mechanism, added to the language with version 1.4, gives you a way to do testing and debugging checks on conditions you expect to smoke out while developing, when you don’t ...

Get OCA/OCP Java SE 7 Programmer I & II Study Guide (Exams 1Z0-803 & 1Z0-804) now with O’Reilly online learning.

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