搜题
用户您好, 请在下方输入框内搜索其它题目:
搜题
题目内容 (请给出正确答案)
提问人:网友 发布时间:
【单选题】

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.

更多“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? ()”相关的问题
第1题

A、 The description of the class and its purpose  B、 A list of methods in its superclass  C、 A list of member variable  D、 The class hierarchy  

点击查看答案
第3题

A、调用类Worker中定义的super()方法  B、调用类Person中定义的super()方法  C、调用类Person的构造函数  D、语法错误  

点击查看答案
客服
TOP

请使用微信扫码支付

订单号:
遇到问题请联系在线客服