Object Type Conversion in Java: Upcasting, Downcasting, and the instanceof Operator
Upcasting: Treating a Subclass as Its Superclass Upcasting occurs when a subclass instance is referenced through a superclass variable, treating the more specialized type as a more general one. Because every subclass is a kind of its parent, this conversion is always safe and requires no explicit ca...