What is the output of the following code?
A)
Test(1)
Test(2)
Test(3)
B) Test(3)
Test(2)
Test(1)
C) Test(2)
Test(1)
Test(3)
D) Test(1)
Test(3)
Test(2)
Answer : D
Explanation : No matter where they are declared, static variables will be initialized before non-static variables
I m still confused about the printing order...In the first call to the constructor why wouldnt Test(2) print before Test(3) even if 2 is initialized later?
[ August 09, 2004: Message edited by: Murtuza Akhtari ]
[ August 09, 2004: Message edited by: Murtuza Akhtari ]