Given:Which exception or error will be thrown when a programmer attempts to run this code?()A.java.lang.StackOverflowErrorB.java.lang.IllegalStateExceptionC.java.lang.ExceptionInInitializerErrorD.java.lang.ArrayIndexOutOfBoundsException

题目
Given:Which exception or error will be thrown when a programmer attempts to run this code?()

A.java.lang.StackOverflowError

B.java.lang.IllegalStateException

C.java.lang.ExceptionInInitializerError

D.java.lang.ArrayIndexOutOfBoundsException


相似考题
更多“Given:Which exception or error will be thrown when a programmer attempts to run this code?() ”相关问题
  • 第1题:

    Given:11.publicclassMyServletextendsHttpServlet{12.publicvoidservice(HttpServletRequestrequest,13.HttpServletResponseresponse)14.throwsServletException,IOException{15.//insertcodehere16.}17.}andthiselementinthewebapplication’sdeploymentdescriptor:<error-page><error-code>302</error-code><location>/html/error.html</location></error-page>Which,insertedatline15,causesthecontainertoredirectcontroltotheerror.htmlresource?()

    A.response.setError(302);

    B.response.sendError(302);

    C.response.setStatus(302);

    D.response.sendRedirect(302);

    E.response.sendErrorRedirect(302);


    参考答案:B

  • 第2题:

    The beautiful mountain village__________ we spent our holiday last year is locatedin __________ is now part of Guangxi.

    A.which ; where
    B.where; what
    C.that ; what
    D.when ; which

    答案:B
    解析:
    where在此充当地点状语,what既充当located in的宾语又充当is的主语,本题考查定语从句和名词性从句。mountain village在定语从句we spent our holiday last year作地点状语,故用关系副词where:第二个考查宾语从句,从句中缺少主语,故用what作主语。故选B。

  • 第3题:

    Error和Exception的区别是:

    A.error只程序执行出错,exception则是逻辑不完善。

    B.error发生后程序会出错,exception发生后不影响程序执行。

    C.error发生后程序会退出执行,exception发生后有可能继续执行。

    D.只要设计合理,error和exception都可以被捕获。


    error&ensp;表示恢复不是不可能但很困难的情况下的一种严重问题。比如说内存溢出。不可能指望程序能处理这样的情况。&ensp;&ensp; exception&ensp;表示一种设计或实现问题。也就是说,它表示如果程序运行正常,从不会发生的情况。

  • 第4题:

    error和exception有什么区别?


    正确答案:
    答:error 表示恢复不是不可能但很困难的情况下的一种严重问题。比如说内存溢出。不可能指望程序能处理这样的情况。
    exception 表示一种设计或实现问题。也就是说,它表示如果程序运行正常,从不会发生的情况。

  • 第5题:

    exception类中有哪个函数?

    A.which()

    B.what()

    C.when()

    D.where()


    what()

  • 第6题:

    4、exception类中有哪个函数?

    A.which()

    B.what()

    C.when()

    D.where()


    what()