given the following code, I have a question:
class A{} class B extends A {} class C extends B{} public class Test { public static void main(String[] args) {
Downcasts are illegal. An A is not a B and therefore you can't cast it to be one. You can cast B to be A, but not the other way round.