Control Flow Statements

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

Get Introduction to Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.