试题详情
- 单项选择题 public class Test { public static void main (String args) { class Foo { public int i = 3; } Object o = (Object) new Foo(); Foo foo = (Foo)o; System.out.printIn(foo. i); } } What is the result?()
A、 Compilation will fail.
B、 Compilation will succeed and the program will print “3”
C、 Compilation will succeed but the program will throw a ClassCastException at line 6.
D、 Compilation will succeed but the program will throw a ClassCastException at line 7.
- B
关注下方微信公众号,在线模考后查看
热门试题
- Which determin
- 向量与数组有何不同?它们分别适合于什么场
- public class&e
- public class&e
- HTTP中的POST和GET在下列哪些方
- public class&e
- 将GUI窗口中的组件按照从左到右如打字式
- swtich(expression)语句
- public class&e
- 一个源文件中只能包含一个类
- 1. public&ensp
- public class&e
- Which statemen
- A web com
- Which two
- public class&e
- 1. class
- 单选(1分)用于执行Java程序的JDK
- What is th
- Given that&ens