欢迎来到在线考试题库网 在线考试题库官网
logo
全部科目 > Java认证考试 > SCJP程序员认证考试

单项选择题

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.

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题