if-else in Java

The BNF of Java if statement includes 3 parts,
```
IfThenStatement:
  if ( Expression ) Statement
IfThenElseStatement:
  if ( Expression ) StatementNoShortIf 
  else Statement
IfThenElseStatementNoShortIf:
  if ( Expression ) StatementNoShortIf 
  else StatementNoShortIf
```
The Expression must have type boolean or Boolean, or a compile-time error occurs.
<b>short if in Java</b>
A "short if" is an if statement without an else. "Short ifs" are not allowed in certain situations to eliminate ambiguity. 
The following is valid Java. There are no "short ifs" and no ambiguity.
```
boolean flag = false;
if (x > 0) 
    if (x > 10)
        flag = true;
    else
        flag = false;
else 
    flag = true;
```
The following is also valid java code, but without the "short if" rules there is ambiguity as to which if the else belongs.
```
if (x > 0)  if (x < 10) flag = true; else  flag = false;
```
The Java BNF of if statement imply that the meaning of the above code is
```
if (x > 0)  
    if (x < 10) 
       flag = true; 
    else  
       flag = false;
```