Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 18
A type conversion from sub type to super type is up casting. In contrast, a type conversion from super type to sub type is down casting. Say, Fruit is a super class and Orange is its subclass. Then, Fruit f1 = new Orange(); // up casting Fruit f2 = new Fruit(); Orange o1 = (Orange) f2; // down casting
6th Apr 2017, 2:23 PM
Shamima Yasmin
Shamima Yasmin - avatar