anybody please tell whether the code is correct or wrong? i think the code is wrong. it produces compiletime error.(forward reference). The order of evaluation is static initilisation,instance initialisation.when the first static block is executing,the variable x is not declared yet.so it should produce error.In the same way other codes also. kinnu
[This message has been edited by kinnu jemmy (edited November 20, 2001).]
This code is wrong. The compiler initializes all static and non-static data in the order in which it is defined in the class. If you use static initializer blocks or non-static initializer blocks, the variables being initialized must be defined above the initializer block. Hope this helps.