The following code compiles successfully:
int x;
if(true)
x=3;
System.out.println(x);
Does that mean the if condition is evaluated at compile time? If so why does the following code not throw Unreachable Statement error?
if(true)
return;
return; //No error
What's the difference?
Aucun commentaire:
Enregistrer un commentaire