Why does following java code not give compilation error for "Unreachable Code" ? It can be easily seen that code will never enter "Line 1" and "Line 2" blocks whatever is the value of flag.
final boolean flag = true;
if (flag) {
System.out.println();
} else if(flag) { //Line 1
System.out.println();
} else if (!flag) {
System.out.println();
} else { //Line 2
System.out.println();
}