Inheritance-Memory mgmt

Aug 21 2009 5:35 AM

Class A{

Public method1()

}

 

Class B:A {

Public method2()

}

 

B bb=new BB();

bb.method1();

bb.method2();

bb can call both methods.

Say bb address is 100

 

At 100: method1 will be there. This address will contain either address of method1 or copy of method2. I am not sure which one. Because of this only, bb will be able to refer method1 also of class A.

 

Plz confirm me.


Answers (1)