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 does an exec sql statement do in abap?
what is defference between repository and non repository Object?
What is logo in sap script?
What are control tables? : abap data dictionary
Did you create primary index?
What is the maximum number of structures that can be included in a table or structure
what is 3 tire architecture and how does SAP utilizes this architecture. and how do netweaver came into picture?
What is pretty printer?
How can you display frames (horizontal and vertical lines) in lists?
What are the events used for logical database?
What are the different types of luws. What are they?
Update types in Call transaction method. What is the difference?
Where are you used type casting?
What is page window?
2)In production what is the user exit?