amit.khosla wrote:That is very unclear.
just to add on...if you create seprate objects of A and B, so the addresses will be different. We cant inherit objects, we inherit classes. It means if you have an object of A and another object of B, they are totally different objects in terms of state they are into. They can share same value, but its not compulsary that they will share same values of i &j.
Extending A means to making a new class which already have properties & behaviour of A.
Hope this help.