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 difference between table and template?
Explain about drill down report?
What are the different types of views in sap? : abap data dictionary
What are conversion & interface programs in sap?
Explain what is a logical database?
How can we determine a vendor is Bloc/Unblock from the table LFA1?
In sap scripts, how will you link form with the event driven?
What are the merits of its?-
What is a bsp application? : sap abap hr
What are the types of parameters in the function modules?
What is the syntex used to call a screen as dialog box (pop up)?
Have you worked with support? How ticket comes to you? What were the timings for resolving tickets types of severity?
How we can give authorization on the fields of table control in a dialog-programming?
What are the advantages/ dis-advantages of logical databases?
What is the name of the system variable that holds the contents of the selected line in interactive reporting?