Here is a code that I encountered while working on the Eclipse IDE.
x = 100;
public static void main(String args)
static int x =1000;
Inside the static block, at the prin statement, it gives me an error "Cannot reference a field before it is defined", whereas, if I comment that, and uncomment the print statement inside main, it works fine. What seems to be the problem here?