Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Narrowing cast and Widening cast.....

Former Member
0 Kudos

Hi all,

Can anyone plz explain me the concept of narrowing cast and widening cast with an example?

Regards,

srini

2 REPLIES 2

Former Member
0 Kudos

Hi Srinivasulu,

Narrowing cast means whenever Sub-Class Reference is Assigned to a Super Class reference it is Narrowing Cast,

Widening cast means Super Class reference is Assigned to a Sub-Class Reference then it is Widening Cast.

See the following links for more information,

[http://help-abap.blogspot.com/2008/09/abap-objects-narrowing-cast-upcasting.html]

[http://help-abap.blogspot.com/2008/09/abap-objects-widening-cast-down-casting.html]

Regards,

Raghava Channooru.

ThomasZloch
Active Contributor
0 Kudos

Please search before posting basic or generic questions.

Thread locked.

Thomas