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

Lock objects and what are parameters of ENQUEUE FM?

1790


what are the 2 other types of views, which are not allowed in release 3.0? : abap data dictionary

1048


What are the different types of mode (run code) in call transaction method?

1182


Under Data Transfer Portion of ABAP, what do you mean by DX Project

2314


What are the aggregate objects in the dictionary? : abap data dictionary

1196


How do you control printer functions from sapscript?

1319


What are system variable in abap?

1111


How can we decide weather we can enhance the standard infotype or not ? : abap hr

1104


What is sequence of event triggered in report?

1029


Explain the types of bdc's?

1022


Polymorphism real time scenario

1517


What is an rfc?

1253


Where do you find info on new developments in SAP?

2022


How to handle error in session method? : abap bdc

1308


Do we have to migrate all sapscript forms to smart forms?

1083