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

Explain the difference between a pool table and a transparent table and how they are stored at the database level?

1193


in bdcsome times we get the ok code for "enter" wrongly instead of '/00'.what is the reason.how we can exceed this problem.

2321


What is the diffreence between bdc_close_group and bdc_close_dataset? : abap bdc

1274


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

2375


What is lock object ? : abap data dictionary

1203


10) How to get Item Header in Sales Order?

2066


What are the system fields? Explain?

1177


What is an on”*-input filed” statement?

1218


What is size category?

1067


What are standard layouts sets in the sap script?

1179


I am uploading 100 records out of which say 59th record has error so what will happen if I am using synchronous or asynchronous method of bdc? Can we update the database using local update mode how? : abap bdc

3527


5) How to rereive text elements in SF and script?

2223


What happens when you post goods issue after delivery? How does the inventory get reduced after the delivery?

1029


What does the insert statement in extract datasets do? : abap modularization

1114


What are the events in abap/4 language? : abap hr

1136