现有:1.classOver{2.intdolt(longx){return3;}3.}4.5.classUnderextendsOver{6.//insertcodehere7.}和四个方法:shortdolt(inty){return4;}intdolt(longXrlongy){return4;}privateintdolt(shorty){return4;}protectedintdolt(longx){return4;}分别插入到第6行,有几个可以通过编译?()A.1B.2C.3D.4
现有:1.classOver{2.intdolt(longx){return3;}3.}4.5.classUnderextendsOver{6.//insertcodehere7.}和四个方法:shortdolt(inty){return4;}intdolt(longXrlongy){return4;}privateintdolt(shorty){return4;}protectedintdolt(longx){return4;}分别插入到第6行,有几个可以通过编译?()
A.1
B.2
C.3
D.4
相关考题:
1.classOver{2.intdoIt(longx){return3;}3.}4.5.classUnderextendsOver{6.//insertcodehere7.}和四个方法:shortdoIt(inty){return4;}intdoIt(longx,longy){return4;}privateintdoIt(Shorty){return4;}protectedintdoIt(longx){return4;}分别插入到第6行,有几个可以通过编译?()A.2B.3C.4D.0E.1
classSynapse{2.protectedintgap(){return7;}3.}4.5.classCrebextendsSynapse{6.//insertcodehere7.}分别插入到第6行,哪三行可以编译?() A.intgap(){return7;}B.publicintgap(){return7;}C.privateintgap(intx){return7;}D.protectedCrebgap(){returnthis;}E.publicintgap(){returnInteger.getInteger(42);}
现有:1.classBook{2.privatefinalvoidread(){System.out.print(book);}3.}4.classPageextendsBook{5.publicstaticvoidmain(String[]args){6.//insertcodehere7.}8.privatefinalvoidread(){System.out.print(page);}9.}和如下三个代码片段(x,y,z):x.//justacommenty.newPage().read();z.newBook().read();分别插入到第6行,有几个允许代码通过编译并可以运行且无异常?()A.0B.1C.2D.3
现有:1.classBook{2.book);}3.}4.classPageextendsBook{5.publicstaticvoidmain(String[]args){6.//insertcodehere7.}8.privatefinalvoidread(){System.out.print(page);}9.}和如下三个代码片段(x,y,z):x.//justacommenty.newPage().read();z.newBook().read();分别插入到第6行,有几个允许代码通过编译并可以运行且无异常?()
现有:1.interfaceAnimal{2.voideat();3.}4.5.//insertcodehere6.7.publicclassHouseCatimplementsFeline{8.publicvoideat(){}9.}和以下三个接口声明:interfaceFelineextendsAnimal{}interfaceFelineextendsAnimal{voideat();}interfaceFelineextendsAnimal{voideat(){}}分别插入到第5行,有多少行可以编译?()A.0B.1C.2D.3
现有:1.classSynapse{2.protectedintgap(){return7;}3.}4.5.classCrebextendsSynapse{6.//insertcodehere7.}分别插入到第6行,哪三行可以编译?() A.intgap(){return7;}B.publicintgap(){return7;}C.privateintgap(intx){return7;}D.protectedCrebgap(){returnthis;}E.publicintgap(){returnInteger.getInteger(42);}
现有:1.abstractclassColor{2.protectedabstractStringgetRGB();3.}4.5.publicclassBlueextendsColor{6.//insertcodehere7.}和四个声明:publicStringgetRGB(){returnblue;}StringgetRGB(){returnblue;)privateStringgetRGB(){returnblue;}protectedStringgetRGB(){returnblue;)分别插入到第6行,有几个可以通过编译?()
现有:1.interfaceAnimalf2.voideat();3.}4.5.//insertcodehere6.7.publicclassHouseCatimplementsFeline{8.publicvoideat(){}9.}和以下三个接口声明:interfaceFelineextendsAnimal()interfaceFelineextendsAnimal{voideat();}interfaceFelineextendsAnimal{voideat(){}}分别插入到第5行,有多少行可以编译?
publicclassBlip{2.protectedintblipvert(intx){return0;}3.}4.classVertextendsBlip{5.//insertcodehere6.}Whichfivemethods,insertedindependentlyatline5,willcompile?() A.publicintblipvert(intx){return0;}B.privateintblipvert(intx){return0;}C.privateintblipvert(longx){return0;}D.protectedlongblipvert(intx,inty){return0;}E.protectedintblipvert(longx){return0;}F.protectedlongblipvert(longx){return0;}G.protectedlongblipvert(intx){return0;}