单项选择题
Which code, inserted at line 16, will cause a java.lang.ClassCastException?()
A.Alpha a=x;
B.Foo f=(Delta)x;
C.Foo f=(Alpha)x;
D.Beta b=(Beta)(Alpha)x;
相关考题
-
单项选择题
What is the result?()
A.Canada
B.null Canada
C.Canada null
D.Canada Canada
E.Compilation fails due to an error on line 26.
F.Compilation fails due to an error on line 29. -
单项选择题
Which is true?()
A.if line 10 is removed, the compilation succeeds.
B.if line 11 is removed, the compilation succeeds.
C.if line 12 is removed, the compilation succeeds.
D.if line 13 is removed, the compilation succeeds.
E.More than one line must be removed for compilation to succeed. -
单项选择题
What is the result?()
A.0, 0, 0
B.150, 60, 0
C.Compilation fails.
D.150, 150, 150
E.An exception is thrown at runtime.
