0

How static members are compiling inside compiler and in run time. Is it declared only at first or initialized. how forward reference is possible if the compiler compiles the code from top to bottom. Anybody explain me he internal function of compiler and JVM while compiling and executing the static variables at forward reference with examples.

Dhivakar
  • 2,081
  • 5
  • 15
  • 18
  • http://stackoverflow.com/questions/335311/static-initializer-in-java?rq=1 – AJ. Jun 24 '16 at 03:08
  • http://stackoverflow.com/questions/146576/why-is-the-java-main-method-static?rq=1 – AJ. Jun 24 '16 at 03:30
  • hi, above links helps me to learn new things but I think I could not raise my – Dhivakar Jun 26 '16 at 19:23
  • hi, above links helps me to learn new things but I think I could not raise my question properly. Exactly my question is what is happening in the compiler when we do forward references. for example,public class ForwardRef { static int i = test(); static int test() { System.out.println(j); j = 20; return j; } static { System.out.println(j); j = 20; } static int j;} – Dhivakar Jun 26 '16 at 19:30

0 Answers0