unreachable-statement

Why does Java have an "unreachable statement" compiler error?

I often find when debugging a program it is convenient, (although arguably bad practice) to insert a return statement inside a block of code. I might try something like this in Java .... class Test { public static void main(String args[]) { System.out.println("hello world"); return; ...

Unreachable expression after launch of new thread.

When the following code is run, it launches the thread r, as the output from it is received but the test phrase is never outputted though there are no errors outputted that would suggest an error. Why is this not able to progress past the thread launch? Will it wait for the thread to be stopped before continuing? while(x<y){ Runnab...