Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to type casting in OOPS ABAP and ABAP ?

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


Please Help Members By Posting Answers For Below Questions

What is the difference between table and template?

1025


Explain about drill down report?

9195


What are the different types of views in sap? : abap data dictionary

1064


What are conversion & interface programs in sap?

1130


Explain what is a logical database?

1061


How can we determine a vendor is Bloc/Unblock from the table LFA1?

2088


In sap scripts, how will you link form with the event driven?

979


What are the merits of its?-

1064


What is a bsp application? : sap abap hr

1126


What are the types of parameters in the function modules?

1105


What is the syntex used to call a screen as dialog box (pop up)?

1160


Have you worked with support? How ticket comes to you? What were the timings for resolving tickets types of severity?

2039


How we can give authorization on the fields of table control in a dialog-programming?

2307


What are the advantages/ dis-advantages of logical databases?

961


What is the name of the system variable that holds the contents of the selected line in interactive reporting?

1214