Section 2: Flow Control, Assertions, and Exception Handling

  • Write code using if and switch statements and identify legal argument types for these statements.

  • Recognize the effect of an exception arising at a specified point in a code fragment. Note: The exception may be a runtime exception, a checked exception, or an error (the code may include try, catch, or finally clauses in any legitimate combination).

  • Write code that makes proper use of assertions, and distinguish appropriate from inappropriate uses of assertions. Identify correct statements about the assertion mechanism.

Relevant Sections

Read Section 5.2 “Selection Statements” and all sections from 5.5 “Stack-based Execution and Exception Propagation” to the end of the chapter.

Study Notes ...

Get Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second 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.