Quantcast
Channel: SCN : Unanswered Discussions - ABAP Development
Viewing all articles
Browse latest Browse all 8768

downcasting

$
0
0

Hi Experts,

 

http://scn.sap.com/thread/3310329

 

I read the above posting to understand especially downcasting (widening casting ?=).

 

How I need to understand it generally?

 

subclass ?= superclass.

With widening casting (Downcasting)  =    accesing/calling  the methods of subclass to runtime.

Which method is called? Method of subclass or superclass?

 

If so, with the refrence "subclass" it is anyway possible to access to its methods. Why this casting??

 

 

 

With upcasting (Narrow Casting ) =   accesing/calling  the methods of superclass

superclass = subclass.

With the refrence "superclass" I am calling the methods of superclass.

Is that right?


Which method is called? Method of superclass or subclass ?

 

 


Please correct me if I have misunderstood, it is very important to clarify me on this topic. I would be very grateful to everybody.

 

Regards

Alex


Viewing all articles
Browse latest Browse all 8768

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>