I don't understand downcasting and upcasting. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I don't understand downcasting and upcasting.

Please, help

4th Feb 2017, 2:52 PM
Hxhxn Djxx
Hxhxn Djxx - avatar
2 Answers
+ 10
When you have a class inside another class and you create an object inside the mother class you can downcast that object to the child class…… (the opposite is called upcasting…)
4th Feb 2017, 3:02 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 2
Thanks , ValentinHacker
4th Feb 2017, 4:05 PM
Hxhxn Djxx
Hxhxn Djxx - avatar