Well, there is a reason behind it. Although we humans can be sure that the right and left codes are equivalent, the compiler scans the branching first and can't make sure that one of the statements will be executed. It does not know inside statements at this stage; so it will assume that "maybe", none of the statements will be executed. So it will raise an error.
RE: An interesting fact about java branches
You are viewing a single comment's thread from:
An interesting fact about java branches