JRJC - How To do Conditional Branching

Brief note for C and C++ programmers

The if
construct in Java is almost the same as in C and C++. The only
difference is when testing for true or false. In C or C++, the
expression had to evaluate to zero or non-zero. In Java, it must
evaluate to a boolean true or false.

All about conditional branching for everybody else

The if construct is probably the most frequently used
construct in any programming language. In Java, the structure looks
like this: