Chapter 5, “Flow Control and Exception Handling”

Java provides a wide array of operators and commands to control program flow and handle exceptions. These operators and commands are summarized in Table 1.

Table 1. Operators and Commands for Flow Control and Exception Handling
StatementDescriptionExample
emptyA statement consisting of just; that performs no operation.;
blockA group of statements enclosed by { and }. The statement block is treated as a single statement when used with selection, interation, and other statements.
{
x += y;
if(x==100)
return y;
)
declarationA statement that declares a variable of being of a particular type and optionally assigns a value to the variable.String s = "abcd";
labeledStatements can be labeled by preceding ...

Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams 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.