[Solved] Is the code after ‘break’ executed? [closed]


As per the specifications

6.6.1 The break statement [stmt.break]

The break statement shall occur only in an iteration-statement or a switch statement and causes termination
of the smallest enclosing iteration-statement or switch statement; control passes to the statement
following the terminated statement, if any.

Hence 1 should not even reach . Some Java compiler might even flag that code unreachable.

1

solved Is the code after ‘break’ executed? [closed]