Instructors' Guide
Introduction
Terminology
Expressions
Control
Objects
Inheritance
Technology
Summary
Control
Java provides roughly the same elementary control structures as C++.
Control
- conditional -- if (b) S1; else S2;
- selection -- switch(n) { case n1: S1; break; ... default: ... }
- iteration -- while (b) S
- looping -- for( int i = 1; i <= MAX; i++) S
- jumps -- return, break, continue
slide: Java -- control
These include a
conditional statement
(of which the else part may be omitted),
a selection statement
(that allows for a default branch),
an iteration statement
(which is also offered in a reversed form
to allow a repeat),
a loop statement
(consisting of an initialization part, a part
to test for termination, and a repetition part to increase
the loop variable)
and, finally, jumps.