Java Reference
In-Depth Information
7
Flow Control
In This Chapter
Code Block
The if Statement
The while Statement
The do...while Statement
The for Statement
The switch Statement
The break, continue Statements
Exercises: Flow Control
Reviewing the Exercises
As with any language, Java defines a set of expressions and rules. The programmer
uses the expressions and follows the rules to define the sequence of steps to be per-
formed by the program. In this chapter, I'll examine the way a Java program man-
ages flow control.
Java borrows heavily from C++, which has borrowed heavily from C. Nowhere
is this relationship more evident than in Java's syntactic definitions, especially the
program flow control operators.
167
Search WWH ::




Custom Search