If i write
private void check(){ if(true) return; String a = "test"; }
The above code works fine, but if I write
private void check(){ return; String a = "test"; }
The compiler / gradle in Android studio does not skip this, even if it is the same, and it says that the code after returning in example 2 is not available.
I have no problem regarding this, but I really want to know why?
java android android-studio javac
Tomek
source share