The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search

Trail: Learning the Java Language
Lesson: The Nuts and Bolts of the Java Language

Summary of Control Flow Statements

while (boolean expression) {
    statements
}
for (initialization ; termination ; increment) {
    statements
}
if (boolean expression) {
    statements
}
if (boolean expression) {
    statements
} else {
    statements
}
if (boolean expression) {
    statements
} else if (boolean expression) {
    statements
}
if (boolean expression) {
    statements
} else if (boolean expression) {
    statements
} else {
    statements
}
switch (integer expression) {
    case integer expression:
         statements
         break;
    ...
    default:
         statements
         break;
}

Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search