black

SCJP程序员认证考试

登录

单项选择题

 class Super { 
public Integer getLenght() { return new Integer(4); }
} 
public class Sub extends Super { 
public Long GetLenght() { return new Long(5); } 
public static void main(String[] args) {
Super sooper = new Super(); 
Sub sub = new Sub(); 
System.out.println( 
sooper.getLenght().toString() + “,” + 
sub.getLenght().toString() );
}
} 
What is the output?()  

A. 4,4
B. 4,5
C. 5,4
D. 5,5
E. Compilation fails.

相关考题

单项选择题 1.packagefoo;2.3.importjava.util.Vector;4.5.protectedclassMyVectorVector{6.initi=1;7.publicMyVector(){8.i=2;9.}10.}11.12.publicclassMyNewVectorextendsMyVector{13.publicMyNewVector(){14.i=4;15.}16.publicstaticvoidmain(Stringargs[]){17.MyVectorv=newMyNewVector();18.}19.}Whatistheresult?()

单项选择题 public class Alpha1 {  public static void main( String[] args ) {  boolean flag; int i=0;  do {  flag = false;  System.out.println( i++ );  flag = i < 10;  continue;  } while ( (flag)? true:false );  }  }  What is the result?()

单项选择题 ClassOne.java:1.packagecom.abe.pkg1;2.publicclassClassOne{3.privatecharvar=‘a’;4.chargetVar(){returnvar;}5.}ClassTest.java:1.packagecom.abe.pkg2;2.importcom.abc.pkg1.ClassOne;3.publicclassClassTestextendsClassOne{4.publicstaticvoidmain(String[]args){5.chara=newClassOne().getVar();6.charb=newClassTest().getVar();7.}8.}Whatistheresult?()

All Rights Reserved 版权所有©财会考试题库(ckkao.com)

备案号:湘ICP备2022003000号-2