有如下代码,请问哪些是正确的?()
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();
A:p0 = p1;
B:p1 = p2;
C:p1 = (ClassB)p3;
D:p2 = (ClassC)p4; |
|