I thought the answer should be 10 but the given answer is 0. Can anyone explain if this is the correct flow of sequence when a class is loaded?? 1. All static initializers are called 2. All static variables are initialized 3. All intance variables are initialized 4. Constructor is called
TIA [ June 17, 2004: Message edited by: Sudhakar Krishnamurthy ]
Instance initializers are executed from top to bottom. That means that this line:
Executes prior to this line:
Therefore, i is being assigned the value of j before j has been assigned a value. By default, j is 0 prior to its initialization so that, 0, is what is assigned to i.