hi, snehal
don't get confused ,you see it's so simple, when you are creating the object of AQuestion
the JVM will call the default constructor which will check for all the defined member variables
and assign them their default values, since you have not coded one for desired initialization
then the value of variable "i" is determined by calling giveMeJ() and at this time j is initialised to
0; the default for int hence you see i as 0 in output.
even if you have called for i value to be printed in the giveMeJ() method it would have printed its default
value which is also 'o'.
::
private int giveMeJ()
{ System.out.println(i);
return j;
}
HOPE THIS HELPS
MUSTAFA
------------------