试题详情
- 单项选择题 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.
- C
关注下方微信公众号,在线模考后查看
热门试题