black

SCJP程序员认证考试

登录

单项选择题

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

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

相关考题

单项选择题 public void test(int x) {  int odd = x%2;  if (odd) {   System.out.println(“odd);  } else {  System.out.println(“even”);  }  }  Which statement is true?()

单项选择题 class Super {  public int getLenght() { return 4; }  }  public class Sub extends Super {  public long getLenght() { return 5; }  public static void main(String[] args) {  Super sooper = new Super();  Sub sub = new Sub();  System.out.println(  sooper.getLenght() + “,” + sub.getLenght() );  }  } What is the output?()

多项选择题 Whichthreestatementsaretrue?()

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

备案号:湘ICP备2022003000号-2