Professional Documents
Culture Documents
1) If and If Else
1) If and If Else
Syntax:
If else Statement:
Syntax:
else
In java we cannot write1,0 or any number inside the if condition, it shows error.
Example:
If (1)
Some code
Else if Statement:
Syntax:
Syntax:
if (Boolean condition 1)
else
In OR (||) operator if condition 1 is true then it will not even check for the condition 2.
Similarly, In AND (&&) Operator, it will check the second condition only if the first condition is true, if the
first condition is false then it will not even check the second condition.