Hi Guys,
I am trying to understand the concept of Narrowing Cast and Widening Cast and getting confused why we are using these Casts. When we can always access the method of Subclass using its ref object in Narrowing ) and use the Super class with its ref object (in Widening).
I understand the concept but could not understand under what situation cast is preferred.There are articles all over the web to explain the concept, but non told us why and when we are forced to us these CASTS.
I will appreciate if somebody can share a small real-time example where use of Narrowing and Widening Cast is advisable.
Thanks,