Originally posted by Chris Allen:
At this point, the A constructor has not completed so the value of i in the A class has not been initialized. Only once A's constructor is completed will the value of A's instance variable i be initialized to 7. The execution continues with the call to A's add() method and you get the value of 2*i, which is 14.
SO at wat stage does 'i' in class A initialized
first of all in A s constructor super() is called
then add is called in b s constructor . but since i in A is not initalized as yet hence 0 is printed
now again add is invoked ,thi stime in A s constructor
so when did i got initialized???