This chapter describes one particular kind of Java statement, called control statements, which allow the building of a program flow according to the logic of the implemented algorithm, which includes selection statements, iteration statements, branching statements, and exception handling statements.
In this chapter, we will cover the following topics:
- What is a control flow?
- Selection statements: if, if....else, switch...case
- Iteration statements: for, while, do...while
- Branching statements: break, continue, return
- Exception handling statements: try...catch...finally, throw, assert
- Exercise – Infinite loop