so before getValue() method was called , i will have 2, to which 3 will be added, getting result of 5.
But before this we have A constructor call which increment the value of i from 2 to 3 and the calling the getValue() method will add 3 to it then it is 6 but it is possible only when the constructor in B is public.
So the finally the value of
i is 6 [ March 05, 2006: Message edited by: gaurav singhal ]