Answer Posted / rs agarwal
1. Narrow casting
2. Wide casting
Demo on "Narrow Casting" Parent class->M1 , Child class-
>M1,M2
Attributes of super class can only be accessed.
Methods defined at Super class(M1) can only be accessed.
Methods with REDEFINED Logic(M1) will be called
Methods in child class (M2) cannot be accessed
Demo on "Wide Casting" Parent class->M1 , Child class->M1,M2
Assign address of PARENT to CHILD Class object
Methods defined at child class(M2) can also be accessed
with Parent reference.
Methods with REDEFINED Logic (M1) will be called
The cast is only possible if the object was instantiated as
the child and then it was casted to the parent object and
then back again to the child object. The child has
everything the parent has so there is no problem with this
path.
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is the last entry in all bdc tables? : abap bdc
What is payroll area
What is the lock object?
Can we write the code both call transaction and session method in single program?
In Table Field when display the Name, whose first charecter should be capital letter and rest will be small letter.
what comes in Timkein written test I hope some body can tell me at this id plz tell it before 9 pm 19 march
Setting up a BDC program where you find information from?
in bdcsome times we get the ok code for "enter" wrongly instead of '/00'.what is the reason.how we can exceed this problem.
What are the functional areas, user groups? How does abap query work in relation to these?
What are the different types of parameters? : abap modularization
Does sap handle multiple currencies?
What is the role of ‘refresh’ in internal table?
What is a collect statement?
Tell me a scenario where did you use secondary index?
How to create any functions? How to go about it?