class ClassA {}
class ClassB extends ClassA {}
class ClassC extends ClassA {}
和
ClassA p0 = new ClassA();
ClassB p1 = new ClassB();
ClassC p2 = new ClassC();
ClassA p3 = new ClassB();
ClassA p4 = new ClassC();
p0 = p1 works
But, p1 = p2 fails compilation....
当两个语句中的层次结构相同时,无法弄清楚为什么会出现这种行为?A --> B --> C