网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
1.classA{3.publicStringtoString(){4.return4”;5.}6.}7.classBextendsA{8.publicStringtoString(){9.returnsuper.toString()+3”;10.}11.}12.publicclassTest{13.publicstaticvoidmain(String[]args){14.System.out.printIn(newB());15.}16.}Whatistheresult()?
A.Compilationsucceedsand4isprinted.
B.Compilation……………isprinted.
C.Anerroronline9causecompilationtofail.
D.Anerroronline14causecompilationtofail.
E.Compilationsucceedsbutanexceptionisthrownatline9.
参考答案
更多 “ 1.classA{3.publicStringtoString(){4.return4”;5.}6.}7.classBextendsA{8.publicStringtoString(){9.returnsuper.toString()+3”;10.}11.}12.publicclassTest{13.publicstaticvoidmain(String[]args){14.System.out.printIn(newB());15.}16.}Whatistheresult()?A.Compilationsucceedsand4isprinted.B.Compilation……………isprinted.C.Anerroronline9causecompilationtofail.D.Anerroronline14causecompilationtofail.E.Compilationsucceedsbutanexceptionisthrownatline9. ” 相关考题
考题
Whatproducesacompilererror?()
A.classA{publicA(intx){}}B.classA{}classBextendsA{B(){}}C.classA{A(){}}classB{publicB(){}}D.classZ{publicZ(int){}}classAextendsZ{}
考题
InwhichtwocasesdoesthecompilersupplyadefaultconstructorforclassA?()
A.classA{}B.classA{publicA(){}}C.classA{publicA(intx){}}D.classZ{}classAextendsZ{voidA(){}}
考题
classA{publicStringtoString(){return4”;}}classBextendsA{8.publicStringtoString(){returnsuper.toString()+3”;}}publicclassTest{publicstaticvoidmain(Stringargs){System.out.printIn(newB());}}Whatistheresult?()A.Compilationsucceedsand4isprinted.B.Compilationsucceedsand43isprinted.C.Anerroronline9causescompilationtofail.D.Anerroronline14causescompilationtofail.E.Compilationsucceedsbutanexceptionisthrownatline9.
考题
有如下模板声明:templatetypename T1,typename 12class A;下列声明中,与上述声明不等价的是A.templateclass T1,class T2class A;B.templateclass T1,typename T2class A;C.templatetypename TI,class T2class A;D.templatetypename T1,T2class A;
考题
若有类A与类B,则以下哪个不属于类的组合关系A.class A { B b; };B.class A { B* p; };C.class A { B bb[3]; };D.class A { public: fun(B b); };
热门标签
最新试卷