6

Flow Control and Exceptions

CERTIFICATION OBJECTIVES

    •    Use if and switch Statements

    •    Develop for, do, and while Loops

    •    Use break and continue Statements

    •    Use try, catch, and finally Statements

    •    State the Effects of Exceptions

    •    Recognize Common Exceptions

    image  Two-Minute Drill

Q&A Self Test

Can you imagine trying to write code using a language that didn’t give you a way to execute statements conditionally? Flow control is a key part of most any useful programming language, and Java offers several ways to accomplish it. Some statements, such as if statements and for loops, are common to most ...

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.