Nested if-else behaviour without braces

From the Java Language Specification:

The Java programming language, like C and C++ and many programming languages before them, arbitrarily decrees that an else clause belongs to the innermost if to which it might possibly belong.

Leave a Comment