This conditional control statement of Java conducts the execution of the
statement if the condition is true and conducts other specified execution
if the condition is false. It consists of an if statement, followed by a
statement or block of statements, followed by the keyword else, followed
by another statement or block of statements. It has the following syntax :
if (expression)
statement 1;
else
statement 2;
If the expression is true, the statement 1 is executed otherwise the
statement 2 is executed. The statement 1 and statement 2 can be a
single statement or a block/compound statements.
attention@computerscienceexpertise.com