public MyObject method1() {
boolean someBoolean = true;
MyObject obj = ...;
if(!someBoolean) method1();
else return obj;
// flow should never come to this statement, but compiler requires this return. why?
return null;
}
为什么java编译器需要最后的return语句?
-Prasanna