6. Control Flow

Image
Image

6.1 Overview of Control Flow Statements

Control flow statements govern the flow of control in a program during execution, meaning the order in which statements are executed in a running program. There are three main categories of control flow statements:

Selection statements: if, if-else, and switch.

Iteration statements: while, do-while, basic for, and enhanced for.

Transfer statements: break, continue, return, try-catch-finally, throw, and assert.

Only the basic form of the try-catch-finally construct is covered here, ...

Get A Programmer’s Guide to Java® SE 8 Oracle Certified Associate (OCA) 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.