Hi,
A cast a conversion from a type to another.
Iimagine we have these elements :
- Class B that inherits from A.
- Functions F1 return a A class type object.
Inside F1 you handle ojects of type B and you want to return it as function return value.
To do that you need to cast B to A ( it is called UP-CASTING) then you can return it.
B objectB = new B()
...
retObject = (A) objectB;
return retObject;
Hope this helps