Decision-Making Statements
Decision-making statements in Java are similar to making a decision in real life, where we have a situation and based on certain conditions we decide what to do next. For example, if it's raining outside then we need to carry an umbrella. In programming also, we have some situations when we need a specific code to be executed only when a condition is satisfied. The decision control statements help us in this task by evaluating a boolean expression and accordingly controlling the flow of the program.
There are 5 types of decision-making statements in Java:
1. if Statement.
2. if-else Statement.
3. Nested if-else Statement.
4. if-else-if Ladder.
5. switch Statement.