📅  最后修改于: 2022-03-11 15:00:07.529000             🧑  作者: Mango
Upcasting is casting to a supertype, while downcasting is casting to a subtype. Upcasting is always allowed, but downcasting involves a type check and can throw a ClassCastException.