hi Can anyone explain why if Line1 is included the class fails to compile (correctly so) but does not complain for Line 2or Line3. IS the initalisation routine follows the source code and should have given the forward refrence error for line 2 and line3
Thanks Ravi
Sunita Vontel
Ranch Hand
Joined: Aug 28, 2000
Posts: 72
posted
0
Hi Ravi I just compiled this program and it gives error saying Cant make forward reference to i, j and l. This is beacuse the static code is initialized first in the order in which it appears.so u cannot make a forward reference.
deekasha gunwant
Ranch Hand
Joined: May 06, 2000
Posts: 396
posted
0
Hi, for me alsoThis program complains at line 1,2,3 for forward referencing. so Ravi can u check it again? regards deekasha
Ravi Prasad
Greenhorn
Joined: Aug 19, 2000
Posts: 3
posted
0
Hi Deeksha and Sunita IF you comment the line 1 then you will not get compile time error and the program will do a correct output. I am using jdk1.3. It's only when you uncomment line 1 you get forward refrencing error. Ravi