This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
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.