3.8.3.An example of illegal access of a nonstatic variable from a static method
public class MainClass { int x = 3; public static void main (String [] args) {
System.out.println("x is " + x);
}
}
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Cannot make a static reference to the non-static field x
at MainClass.main(MainClass.java:4)