试题详情
- 多项选择题 10. interface Foo { 11. int bar(); 12. } 13. 14. public class Beta { 15. 16. class A implements Foo { 17. public int bar() { return 1; } 18. } 19. 20. public int fubar( Foo foo) { return foo.bar(); } 21. 22. public void testFoo() { 23. 24. class A implements Foo { 25. public int bar() { return 2; } 26. } 27. 28. System.out.println( fubar( new A())); 29. } 30. 31. public static void main( String[] argv) { 32. new Beta().testFoo(); 33. } 34. } Which three statements are true?()
A、 Compilation fails.
B、 The code compiles and the output is 2.
C、 If lines 16, 17 and 18 were removed, compilation would fail.
D、 If lines 24, 25 and 26 were removed, compilation would fail.
E、 If lines 16, 17 and 18 were removed, the code would compile and the output would be 2.
F、 If lines 24, 25 and 26 were removed, the code would compile and the output would be 1.
- B,E,F
关注下方微信公众号,在线模考后查看
热门试题
- 如果源文件中包含public类,源文件的
- public class&e
- public class&e
- 以下不属于tcp连接断开的状态是()。
- 什么是递归方法?递归方法有哪两个基本要素
- You have
- Given a class Repet
- 集合API中Set接口的特点是哪项?()
- public class&e
- You are b
- You are c
- A派生出子类B,B派生出子类C,并且在j
- 程序: cla
- Which implicit
- 以下各项哪些不能成为GUI事件源?()&
- You are c
- ++op运算符的作用是先将变量的值加1再
- 求1900年~2003年所有闰年年号之和
- 编写一个JavaApplet,使之能够在
- 在事件委托类的继承体系中,最高层次的类是