多选题class ClassA {}  class ClassB extends ClassA {}  class ClassC extends ClassA {}  and:  ClassA p0 = new ClassA();  ClassB p1 = new ClassB();  ClassC p2 = new ClassC();  ClassA p3 = new ClassB();  ClassA p4 = new ClassC();  Which three are valid?()Ap0 = p1;Bp1 =p2;Cp2 = p4;Dp2 = (ClassC)p1;Ep1 = (ClassB)p3;Fp2 = (ClassC)p4;

多选题
class ClassA {}  class ClassB extends ClassA {}  class ClassC extends ClassA {}  and:  ClassA p0 = new ClassA();  ClassB p1 = new ClassB();  ClassC p2 = new ClassC();  ClassA p3 = new ClassB();  ClassA p4 = new ClassC();  Which three are valid?()
A

p0 = p1;

B

p1 =p2;

C

p2 = p4;

D

p2 = (ClassC)p1;

E

p1 = (ClassB)p3;

F

p2 = (ClassC)p4;


参考解析

解析: 暂无解析

相关考题:

有以下程序: #includeiostream usingnamespacestd; classA{ public: A( ){cout"A";} }; classB{public:B( ){cout"B";}}; classC:publicA{ Bb; public: C( ){cout"C";} }; intmain( ){Cobj;return0;} 执行后的输出结果是( )。A.CBAB.BACC.ACBD.ABC

Whatproducesacompilererror?() A.classA{publicA(intx){}}B.classA{}classBextendsA{B(){}}C.classA{A(){}}classB{publicB(){}}D.classZ{publicZ(int){}}classAextendsZ{}

classA{A(){}}classBextendsA{}Whichtwostatementsaretrue?() A.ClassB’sconstructorispublic.B.ClassB’sconstructorhasnoarguments.C.ClassB’sconstructorincludesacalltothis().D.ClassB’sconstructorincludesacalltosuper().

Click the Exhibit button. Given: ClassA a = new ClassA(); a.methodA(); What is the result? () A.Compilation fails.B.ClassC is displayed.C.The code runs with no output.D.An exception is thrown at runtime.

下面程序段的输出结果为 package test; public class ClassA { int x=20; static int y=6; public static void main(String args[]) { ClassB b=new ClassB(); b.go(10); System.out.println("x="+b.x); } } class ClassB { int x; void go(int y) { ClassA a=new ClassA(); x=a.y; } }A.x=10B.x=20C.x=6D.编译不通过

下面程序输出的结果为 #include"iostream.h" class A { public: A(){cout<<"CLASSA"<<endl;} ~A() {} }; class B:public A { public: B(){cout<<"CLASSB"<<endl;} ~B() {} }; void main() { A * p; p=new B; B *q; q=new B; }A.CLASS A CLASS BB.CLASS A CLASS B CLASS BC.CLASS A CLASS B CLASS A CLASS BD.CLASS A CLASS B CLASS B CLASS B

下面程序段的输出结果为( )。 package test; public class ClassA { int x=20: static int y=6; public static void main(String args[]) { ClassB b=new ClassB; go(10); System.out.println("x="+b.x); } } class ClassB { int X; void go(int y) { ClassA a=new ClassA; x=a.Y ; } }A.x=10B.x=20C.x=6D.编译不通过

下面程序输出的结果为( )。 #include"iostream.h" classA {public: A(){cOUt"CLASSA"endl;} ~A(){}}; ClaSSB:publicA {public: B(){cout"CLASSB"endl;} ~B(){}}; voidmain() {A*P; P=newB: B*q: q=newB;}A.CLASSAB.CLASSA CLASSBCLASSB CLASSBC.CLASSAD.CLASSA CLASSBCLASSB CLASSACLASSB CLASSBCLASSB

有以下源程序: package test; public class ClassA { int x=20; static int y=6; public static void main(String args[]) { ClassB b=new ClassB(); b.go(10); System.out.println("x="+b.x); } } class ClassB { int x; void go(int y) { ClassA a=new ClassA(); x=a.y; } } 上述源程序文件的运行结果为( )。A.x=10B.x=20C.x=6D.编译不通过

下面程序输出的结果为( )。 includeiostream.hclassA{public: A(){cOUtiostream.hclassA{public:A(){cOUtCLASSAendl;}~A(){}};ClaSSB:publicA{public:B(){coutCLASSBendl;}~B(){}};voidmain(){A*P;P=newB:B*q:q=newB;}A.CLASSBB.CLASSA CLASSB CLASSBC.CLASSA CLASSB CLASSA CLASSBD.CLASSA CLASSB CLASSB CLASSB

下面程序段的输出结果为 package test; public class Class A { int x=20; static int y=6; public static void main(String args[]) { Class B b=new Class B(); b.go(10); System.out.println("x"+b.x); } } class ClassB { int x; void go(int y) { ClassA a=new ClassA(); x=a.y; } }A.x=10B.x-20C.x=6D.编译不通过

10. public class ClassA {  11. public void count(int i) {  12. count(++i);  13. }  14. }  And:  20. ClassA a = new ClassA();  21. a.count(3);  Which exception or error should be thrown by the virtual machine?() A、 StackOverflowErrorB、 NullPointerExceptionC、 NumberFormatExceptionD、 IllegalArgumentExceptionE、 ExceptionlnlnitializerError

GPRS服务类型有CLASS A、CLASS B、CLASS C三种:()在上网的时候会将电话功能屏蔽,当有电话进来的时候自动切断网络;()可以同时使用网络和电话功能;()则是单纯的网络应用, 不提供电话功能。A、CLASSB;CLASSA;CLASSCB、CLASSA;CLASSB;CLASSCC、CLASSC;CLASSB;CLASSAD、CLASSC;CLASSA;CLASSB

Given: class ClassA {} class ClassB extends ClassA {} class ClassC extends ClassA {} and: ClassA p0 = new ClassA(); ClassB p1 = new ClassB(); ClassC p2 = new ClassC(); ClassA p3 = new ClassB(); ClassA p4 = new ClassC(); Which three are valid?()A、p0 = p1;B、p1 = p2;C、p2 = p4;D、p2 = (ClassC)p1;E、p1 = (ClassB)p3;F、p2 = (ClassC)p4;

现有:  class ClassA  {}  class ClassB extends ClassA  {)      class ClassC extends ClassA  {)     以及:  ClassA p0=new ClassA();      ClassB pl=new ClassB();      ClassC p2=new ClassC();     ClassA p3=new ClassB();    ClassA p4=new ClassC(); 下列哪些是正确的?()A、p0=pl;B、p1 =p2;C、p2=p4;D、p2 = (ClassC)pl;E、p1 = (ClassB)p3;F、p2 =  (Classc)p4;

什么情况下,电路域要寻呼UE,寻呼消息通过Iups接口下发?()A、UE模式为CLASSA,网络工作在NETMODEII;B、UE模式为CLASSB,网络工作在NETMODEI;C、UE模式为CLASSA,网络工作在NETMODEI;D、UE模式为CLASSC,网络工作在NETMODEI;

class ClassA {  public int numberOfinstances;  protected ClassA(int numberOfinstances) {  this.numberOflnstances = numberOfinstances;  }  }  public class ExtendedA extends ClassA {  private ExtendedA(int numberOfinstances) {  super(numberOflnstances);  }  public static void main(String[] args) {  ExtendedA ext = new ExtendedA(420);  System.out.print(ext.numberOflnstances);  }  }  Which is true?() A、 420 is the output.B、 An exception is thrown at runtime.C、 All constructors must be declared public.D、 Constructors CANNOT use the private modifier.E、 Constructors CANNOT use the protected modifier.

10. public class ClassA {  11. public void methodA() {  12. ClassB classB = new ClassB();  13. classB.getValue();  14. }  15. }  And:  20. class ClassB {  21. public ClassC classC;  22.  23. public String getValue() {  24. return classC.getValue();  25. }  26. }  And:  30. class ClassC {  31. public String value;  32.  33. public String getValue() {  34. value = “ClassB”;  35. return value;  36. }  37. }  Given:  ClassA a = new ClassA();  a.methodA();  What is the result?()A、 Compilation fails.B、 ClassC is displayed.C、 The code runs with no output.D、 An exception is thrown at runtime.

public class ClassA {  public int getValue() {  int value=0;  boolean setting = true;  String title=”Hello”;  (value || (setting  title == “Hello”)) { return 1; }  (value == 1  title.equals(”Hello”)) { return 2; }  }  } And:  ClassA a = new ClassA();  a.getValue();  What is the result?() A、 1B、 2C、 Compilation fails.D、 The code runs with no output.E、 An exception is thrown at runtime.

class ClassA {}  class ClassB extends ClassA {}  class ClassC extends ClassA {}  and:  ClassA p0 = new ClassA();  ClassB p1 = new ClassB();  ClassC p2 = new ClassC();  ClassA p3 = new ClassB();  ClassA p4 = new ClassC();  Which three are valid?()A、 p0 = p1;B、 p1 =p2;C、 p2 = p4;D、 p2 = (ClassC)p1;E、 p1 = (ClassB)p3;F、 p2 = (ClassC)p4;

单选题Click the Exhibit button.   Given: ClassA a = new ClassA();   a.methodA();   What is the result?()A  The code runs with no output.B  Compilation fails.C  An exception is thrown at runtime.D  ClassC is displayed.

问答题类ClassB从ClassA派生,那么ClassA*a=newClassB(…);试问该表达是否合法?为什么?

单选题10. public class ClassA {  11. public void count(int i) {  12. count(++i);  13. }  14. }  And:  20. ClassA a = new ClassA();  21. a.count(3);  Which exception or error should be thrown by the virtual machine?()A StackOverflowErrorB NullPointerExceptionC NumberFormatExceptionD IllegalArgumentExceptionE ExceptionlnlnitializerError

多选题Given: class ClassA {} class ClassB extends ClassA {} class ClassC extends ClassA {} and: ClassA p0 = new ClassA(); ClassB p1 = new ClassB(); ClassC p2 = new ClassC(); ClassA p3 = new ClassB(); ClassA p4 = new ClassC(); Which three are valid?()Ap0 = p1;Bp1 = p2;Cp2 = p4;Dp2 = (ClassC)p1;Ep1 = (ClassB)p3;Fp2 = (ClassC)p4;

多选题Given: Which three are valid?()Ap0 = p1;Bp1 = p2;Cp2 = p4;Dp2 = (ClassC)p1;Ep1 = (ClassB)p3;Fp2 = (ClassC)p4;

多选题现有:  class ClassA  {}  class ClassB extends ClassA  {)      class ClassC extends ClassA  {)     以及:  ClassA p0=new ClassA();      ClassB pl=new ClassB();      ClassC p2=new ClassC();     ClassA p3=new ClassB();    ClassA p4=new ClassC(); 下列哪些是正确的?()Ap0=pl;Bp1 =p2;Cp2=p4;Dp2 = (ClassC)pl;Ep1 = (ClassB)p3;Fp2 =  (Classc)p4;

多选题什么情况下,电路域要寻呼UE,寻呼消息通过Iups接口下发?()AUE模式为CLASSA,网络工作在NETMODEII;BUE模式为CLASSB,网络工作在NETMODEI;CUE模式为CLASSA,网络工作在NETMODEI;DUE模式为CLASSC,网络工作在NETMODEI;

单选题GPRS服务类型有CLASS A、CLASS B、CLASS C三种:()在上网的时候会将电话功能屏蔽,当有电话进来的时候自动切断网络;()可以同时使用网络和电话功能;()则是单纯的网络应用, 不提供电话功能。ACLASSB;CLASSA;CLASSCBCLASSA;CLASSB;CLASSCCCLASSC;CLASSB;CLASSADCLASSC;CLASSA;CLASSB