please someone explain why this program gives a compile error.
class Example{
public static void main(String args[]){
final int x;
x=101;
int y;
if(x>100){
y=-1;
}
System.out.println(y);
}
}
And likely, this one too. There seems to be a large group asking the same similar questions, at the same time -- probably caused by the people taking the same class.
So, this is a reminder to all ranchers, please SearchFirst. Your question may already been answered.