publicclass MainClass {
int x = 3;
publicstaticvoid 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)