Flow control with if and else

The if and else statements allow a block of code or a single statement to be ither executed or bypassed depending upon the result of a comparison operation.

They are an essential part of Java “flow control” by which execution may proceed along alternate logic paths within a program.