The if statement is the java's conditional branch statement. The general form of if statement is :
where the condition can be any expression that produces a value true or false.
If the condition is true, the statement that follows the if is executed.
Otherwise the statement will not execute.
Or, if it contains a block of statement, then if the condition is true then all the statements will execute, and if the condition is false then the control execute the second statement onwards.