please try the following code:
public class Arg {
public static void main(
String args[]) {
int x = 10, y;
if(x < 10) y = 1;<br /> if(x >= 10) y = 8; //line 1
//else y = 8; //line 2
System.out.println("y is " + y);
}
}
the code will give compile error, but if you use the line2 instead of line 1 it works fine.
Can someone explain to me why and how this happen,
Thanks!