On this page, we will learn control structures. Control structures are blocks of statements that are executed based on conditions. This is very useful when we make decisions. We can control the flow of the program using control structures and branch base on the conditions.
If-else statement is used for decision making. If the expression is true one set of statement(s) is executed and if the expression id false another set of statement(s) is executed. Java program using the if-else clause statement:
Nested if demo java program: