This does not compile, giving an unreachable statement
error:
while(true)
{
}
return null;
while this does not have any compilation issues though we know that it is equivalent to the snippet above:
while(true)
{
if(4>5)
break;
}
return null;
Does the compiler simply search for a break statement and think that there's some way that the loop may terminate and so does not worry about it?