Downcasting in Java
Downcasting is allowed when there is a possibility that it succeeds at run time: In some cases this will not succeed: When a cast (such as this last one) fails at runtime a ClassCastException will be thrown. In other cases it will work: Note that some casts will be disallowed at compile time, because they … Read more