Member access and inheritance in ABAP Objects

Go down

Member access and inheritance in ABAP Objects

Post  Uma_ABAP on Sun Apr 01, 2012 1:00 pm

As we know that in inheritance the subclass inherits the property of the super class ,now
the question comes can the subclass inherit all the property of the super class ?? the answer is no ,only the public and the protected members are inheritable by the sub class.

Now what happens if any component of the superclass has the same name that of the sub class ?? This is only possible in case of private components ,the private components of a super class or subclass does not interfere or interact they are sole property of the class in which they are declared .

Where as public or protected components must be unique i.e they must not have same name .

Another question might come up , suppose a super class method is called by the subclass ,and suppose it takes some input parameters that are private , and the input parameters are explicitly defined both in sub class as well as in super class ,then during the function call which components does it uses ,is it of super class or that of subclass.??

Well it uses the components of the super class.


Posts : 56
Join date : 2012-03-31

Back to top Go down

Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum