I am confused about this that if compilation fails at Line 20 then why it does not fails at Line 14. In Line 20 compiler is showing "Unreachable code" as an error, so according to me Line 14 should also give the same compiler error, but it is not so. Can anyone help me out with this doubt?
This question isn't going about Assertions particularly. Any code after the while statement will cause error because the condition of the loop is known by the compiler to always be true it will go into infinite looping and no code under it will get a chance to execute.