Why does this work:
public class demo { static int a; public static void main(String args[]) { System.out.println(a); } }
But this does not:
public class demo { int a; public static void main(String args[]) { System.out.println(a); } }
And this one also does not:
public class demo { public static void main(String args[]) { static int a; System.out.println(a); } }