
208 CHAPTER 5 Flow of Control,Part 1: Selection
Introduction
In Chapter 1, we said that the order of a program’s instructions is critical
to producing correct results. The order in which the instructions are exe-
cuted is called the flow of control of the program. There are essentially
four types of flow of control: sequential execution, method calls, selec-
tion, and looping. Most programs use a combination of all types of flow
of control.
So far, our programs have used sequential execution and method calls
exclusively. In our Java applications, the JVM executed the first instruction
in the main method, then executed the next instruction in main, and ...