J2EE Spring Hibernate Chapter 27: if and switch Statements

The if and switch statements are commonly referred to as decision statements. When we use decision statements in our program, we’re asking the program to evaluate a given expression to determine which course of action to take.

Let us start with the if-else block

if-else Branching

The basic format of an if statement is as follows:
if (booleanExpression) {
System.out.println("Inside if