if (5 == 5)
{
}
In this case, if
5
is equal to
5
, then the code inside the ¬
if
block is executed.
if (5 == 4)
{
}
else
{
}
In this case, if
5
is equal to
4
, then the code inside the
if
block is executed.
If
5
is NOT equal to
4
, then the code inside the else block is executed.
if (5 == 4)
{
}
else if (5 == 6)
{
}
In this case, if
5
is equal to
4
, then the code inside the
if
block is executed.
If
5
is not equal to
4
, then the code in the
else if
block will only get executed if
5
is equal to
6
.
Hope this helps.