问题:
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.
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?()
● 参考解析
本题暂无解析
相关内容
相关标签