Skip to main content

if Java Keyword


The if keyword indicates conditional execution of a block. The condition must evaluate to a boolean value.

Examples

if (condition)
{
<statements>
}
if (condition)
{
<statements>
}
else
{
<statements>
}

Comments