black

SCJP程序员认证考试

登录

单项选择题

class super { 
public int getLength()  {return 4;} 
} 
public class Sub extends Super { 
public long getLength() {return 5;} 
public static void main (String[]args)  { 
super sooper = new Super (); 
Sub sub = new Sub(); 
System.out.printIn( 
sooper.getLength()+ “,” + sub.getLength()   }; 
} 
What is the output?()  

A. 4, 4
B. 4, 5
C. 5, 4
D. 5, 5
E. The code will not compile.

相关考题

多项选择题 Whichtwostatementsaretrueregardingthecreationofadefaultconstructor?()

单项选择题 1. public class ArrayTest {  2. public static void main (String[]args)  {  3. float f1[], f2[];  4. f1 = new float [10];  5. f2 = f1;  6. System.out.printIn (“f2[0]=” + f2[0]);  7.  }  8. }   What is the result?()

单项选择题 ClassOne.java  1. package com.abc.pkg1;  2. public class ClassOne {  3. private char var = ‘a’;   4. char getVar()  {return var;}  5. }  ClassTest.java    1. package com.abc.pkg2;  2. import com.abc.pkg1.ClassOne;  3. public class ClassTest extends ClassOne {  4.   public static void main(String[]args)  {  5.     char a = new ClassOne().getVar();  6.     char b = new ClassTest().getVar();   7.   }  8. }      What is the result?()

All Rights Reserved 版权所有©求知题库网库(csqiuzhi.com)

备案号:湘ICP备14005140号-1

经营许可证号:湘B2-20140064