When there is some statement written after the infinite loop, that statement becomes the unreachable code. For ex:
for(;;)
{
}
Sytem.out.println(\"Test-1\")
for(final int z=4;z<6;)
{
}
System.out.println("Test-2"); //unreachable code --> z is final. Its value can't change. There is no way out of that loop
final int z=4;
for(;;)
{
if(z<2) // z is 4 . The compiler only knows the value of "z". It doesn't know what z<2 evaluates to.. So, it still thinks taht there is a chance of getting out of that loop.
break;
}
System.out.println("Test-3"); //So --> reachable code.