Control flow statements govern the flow of control in a program during execution, that is, the order in which statements are executed in a running program. There are three main categories of control flow statements that are discussed in this chapter:
Selectionstatements:
if, if-else and switch.
Iterationstatements:
while, do-while and for.
Transferstatements:
break, continue, return, try-catch-finally and assert.