posted 18 years ago
Before constructor call,first static fields,static blocks are executed(depending on order of definition),then instance fields,instance blocks, super class constructor then actual constructor will be executed.So, before Q028, constructor of B class is called which in turn calls A construtor, before which static field i will be initialized to 0, then in A's constructor , i will be incremented to 1,then called will be returned to B's constructor where i will be incremented to 2,
so before getValue() method was called , i will have 2, to which 3 will be added, getting result of 5.