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 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.