A Java program is a sequence of statements that can be executed and produce some data or/and initiate some actions. To make the program more generic, some statements are executed conditionally, based on the result of an expression evaluation. Such statements are called control flow statements because, in computer science, control flow (or flow of control) is the order in which individual statements are executed or evaluated.
By convention, they are divided into four groups: selection statements, iteration statements, branching statements, and exception handling statements.
In the following sections, we will use the term block, which means a sequence of statements enclosed in braces. Here is an example:
{
x = 42;
y = method(7, x);
System.out.println("Example");
}
A block can also include control statements – a doll inside a doll,...