//even when the y is declared outside compiler says that value of y is unassigned.Is this error is because y is a local variable of main() method
or is there any other reason.thanks.
public class Compare2{
public static void main(
String args[]) {
int x = 10, y;
System.out.println("y is " + y);
}
}