当前位置:SCJP程序员认证考试题库

问题:

[单选]

class A {  
public byte getNumber () {  
return 1;  
}  
}  
class B extends A {  
public short getNumber() {  
return 2;  
}  
 public static void main (String args) {  
B b = new B ();  
 System.out.printIn(b.getNumber()) 
}  
}  
What is the result?()  

A .  Compilation succeeds and 1 is printed.
B .  Compilation succeeds and 2 is printed.
C .  An error at line 8 causes compilation to fail.
D .  An error at line 14 causes compilation to fail.
E .  Compilation succeeds but an exception is thrown at line 14.

兴趣 作为可获得的廉价植物性蛋白来源,鸡蛋在全世界都是基本食物。 蒙台梭利课程的教育内容由()、()、()和()这4个方面组成。 动态价格政策:根据不同的个体顾客和情况制定不同的价格。 检测仪表通常由()三大功能部件及传输通道组成. A.A.RM. 。 B.传感器 。 C.显示器 。 D.变送器。

class A {  
public byte getNumber () {  
return 1;  
}  
}  
class B extends A {  
public short getNumber() {  
return 2;  
}  
 public static void main (String args) {  
B b = new B ();  
 System.out.printIn(b.getNumber()) 
}  
}  
What is the result?()  

参考答案:

  参考解析

本题暂无解析

在线 客服