I guess the last statement "assert false;" is unreachable, thats why u r getting a compiler error.
Joined: Mar 02, 2005
If lineno 20 is unreahable then lineno 14 should also be unreachable...
Joined: Jul 19, 2004
Vidya, Until the JVM runs with assert flag enabled, u may not be able to determine whether the statement will ever be reachable. What if u dont run with the Assertions Enabled. U may just get blank output, right?
So compiler checks for only those which u can determine during compile time itself whether its reachable or not.