The method below cannot be executed in Java because the variable i
may remain uninitialized by the time of its use. Is this an issue of syntax or semantics?
public int odd( boolean b ){
int i;
if( b ){ i = 3;}
return i;
}
I would've thought it would be semantics, but according to my instructor it is a syntax error. Is that correct, and why?