Java statements that allows us to select and execute specific blocks of code while skipping other sections.
if-statement specifies that a statement (or block of code) will be executed if and only if a certain boolean statement is true.
The if-statement has the form, where, boolean expression is either a boolean expression or boolean variable.
The if-statement has the form, where, boolean expression is either a boolean expression or boolean variable.
The boolean_expression part of a statement should evaluate to a boolean value. That means that the execution of the condition should either result to a value of true or false
The boolean_expression part of a statement should evaluate to a boolean value. That means that the execution of the condition should either result to a value of true or false
if-else statement is used when we want to execute a certain statement if a condition is true, and a different statement if the condition is false
switch statement has been matched, all the statements associated with that case are executed. Not only that, the statements associated with the succeeding cases are also executed.
To prevent the program from executing statements in the subsequent cases, we use a break statement as our last statement