1
0

Control Statements in Java

The statements inside your source code file are generally executed from top to bottom, in the order in which they appear in the program source code. The Control flow statements, however, break the execution flow by employing decision-making, looping, and branching statements, enabling your program to execute particular blocks of code conditionally. This section describes the following statements supported by the Java programming language:

  1. Branching statements(if, if-else, switch)
  2. Looping statements (for, while, do-while)
  3. Jumping statements (break, continue, return)

control statements in java

Branching statements are used to select a block of code for execution depending upon certain conditions. These statements are also called selection statements. Java language provides two selection statements named if-else and switch-case. These statements are discussed in the next articles.

Leave a Reply