参考答案和解析
正确答案: Number Format Exception、ClassCast Exception和NullPointer Exception
更多“列举三个常见的Runtime Exception子类。”相关问题
  • 第1题:

    给我一个你最常见到的runtime exception。


    正确答案:

     

    ArithmeticException, ArrayStoreException, BufferOverflowException,

    BufferUnderflowException, CannotRedoException, CannotUndoException,

    ClassCastException, CMMException, ConcurrentModificationException, DOMException,

    EmptyStackException, IllegalArgumentException, IllegalMonitorStateException,

    IllegalPathStateException, IllegalStateException, ImagingOpException,

    IndexOutOfBoundsException, MissingResourceException, NegativeArraySizeException,

    NoSuchElementException, NullPointerException, ProfileDataException, ProviderException,

    RasterFORMatException, SecurityException, SystemException,

    UndeclaredThrowableException, UnmodifiableSetException,

    UnsupportedOperationException

  • 第2题:

    能抛出异常必须是下列哪个类或其子类的实例?

    A.throws

    B.throw

    C.Throwable

    D.Exception


    正确答案:C
    解析:通常我们都知道所有自己创建的异常对象都必须是Exception的实例或它的子类的实例;但在题日中的要求是抛出异常,不是自己创建的异常对象,这两种的区别在于抛出异常中有可能继承了Error类,所以它应是Throwable类或其子类的实例。Throwable类分为Error和Exception两子类。

  • 第3题:

    Which the statement is true?()

    • A、 The Error class is a Runtime Exception.
    • B、 No exceptions are subclasses of Error.
    • C、 Any statement that may throw an Error must be enclosed in a try block.
    • D、 any statement that may throw an Exception must be enclosed in a try block.
    • E、 Any statement that may throw an Runtime Exception must be enclosed in a try block.

    正确答案:B

  • 第4题:

    关于异常,以下说法正确的有()。

    • A、运行时异常使用Runtime Exception的子类来表示,不用在可能抛出异常的方法声明上加throws子句
    • B、运行时异常使用Runtime Exception的子类来表示,必须在可能抛出异常的方法声明上加throws子句
    • C、非运行期异常是从Exception继承而来的,必须在方法声明上加throws子句
    • D、非运行期异常是从Exception继承而来的,不需要在方法声明上加throws子句

    正确答案:A,C

  • 第5题:

    Which step can be used to trap runtime script errors and recover gracefully?()

    • A、Set  
    • B、Call Subflow  
    • C、On Exception Goto  
    • D、Get Reporting Statistic 

    正确答案:C

  • 第6题:

    public class TestOne {  public static void main (String[] args) throws Exception {  Thread.sleep(3000);  System.out.println(”sleep”);  }  }  What is the result?() 

    • A、 Compilation fails.
    • B、 An exception is thrown at runtime.
    • C、 The code executes normally and prints “sleep”.
    • D、 The code executes normally, but nothing is printed.

    正确答案:C

  • 第7题:

    单选题
    Which the statement is true?()
    A

     The Error class is a Runtime Exception.

    B

     No exceptions are subclasses of Error.

    C

     Any statement that may throw an Error must be enclosed in a try block.

    D

     any statement that may throw an Exception must be enclosed in a try block.

    E

     Any statement that may throw an Runtime Exception must be enclosed in a try block.


    正确答案: E
    解析: 暂无解析

  • 第8题:

    多选题
    关于异常,以下说法正确的有()。
    A

    运行时异常使用Runtime Exception的子类来表示,不用在可能抛出异常的方法声明上加throws子句

    B

    运行时异常使用Runtime Exception的子类来表示,必须在可能抛出异常的方法声明上加throws子句

    C

    非运行期异常是从Exception继承而来的,必须在方法声明上加throws子句

    D

    非运行期异常是从Exception继承而来的,不需要在方法声明上加throws子句


    正确答案: B,C
    解析: 暂无解析

  • 第9题:

    单选题
    Given: What is the result?()
    A

    peep

    B

    bark

    C

    meow

    D

    Compilation fails.

    E

    An exception is thrown at runtime.


    正确答案: E
    解析: 暂无解析

  • 第10题:

    问答题
    列举三个常见的Runtime Exception子类。

    正确答案: Number Format Exception、ClassCast Exception和NullPointer Exception
    解析: 暂无解析

  • 第11题:

    单选题
    Given: What is the result?()
    A

    Afoo Afoo

    B

    Afoo Bfoo

    C

    Bfoo Afoo

    D

    Bfoo Bfoo

    E

    Compilation fails.

    F

    An exception is thrown at runtime.


    正确答案: D
    解析: 暂无解析

  • 第12题:

    单选题
    Given: What is the result?()
    A

    7

    B

    49

    C

    343

    D

    Compilation fails.

    E

    An exception is thrown at runtime.


    正确答案: E
    解析: 暂无解析

  • 第13题:

    Runtime Exception和Exception区别?


    正确答案:
     

  • 第14题:

    static void test() throws RuntimeException {  try {  System.out.print(”test “);  throw new RuntimeException();  }  catch (Exception ex) { System.out.print(”exception “); }  }  public static void main(String[] args) {  try { test(); }  catch (RuntimeException ex) { System.out.print(”runtime “); }  System.out.print(”end “);  }  What is the result?() 

    • A、 test end
    • B、 Compilation fails.
    • C、 test runtime end
    • D、 test exception end
    • E、 A Throwable is thrown by main at runtime.

    正确答案:D

  • 第15题:

    public class Yippee2{ stati cpublic void main(String[]yahoo){ for(intx=1;x

    • A、ab
    • B、bc
    • C、abc
    • D、Compilation fails.
    • E、An exception is thrown at runtime.

    正确答案:B

  • 第16题:

    以下哪四个能使用throw抛出?()

    • A、Error
    • B、Event
    • C、Object
    • D、Throwable
    • E、Exception
    • F、Runtime Exception

    正确答案:A,D,E,F

  • 第17题:

    public class Yippee {  public static void main(String [] args) {  for(int x = 1; x < args.length; x++) {  System.out.print(args[x] +“ “);  }  }  }  and two separate command line invocations:  java Yippee  java Yippee 1234  What is the result?() 

    • A、 No output is produced. 123
    • B、 No output is produced. 234
    • C、 No output is produced. 1234
    • D、 An exception is thrown at runtime. 123
    • E、 An exception is thrown at runtime. 234
    • F、 An exception is thrown at rijntime. 1234

    正确答案:B

  • 第18题:

    单选题
    Given: What is the output?()
    A

    42

    B

    420

    C

    462

    D

    42042

    E

    Compilation fails.

    F

    An exception is thrown at runtime.


    正确答案: E
    解析: 暂无解析

  • 第19题:

    单选题
    Given: What is the result?()
    A

     An exception is thrown at runtime.

    B

     int Long

    C

     Compilation fails.

    D

     Short Long


    正确答案: A
    解析: 暂无解析

  • 第20题:

    单选题
    public class Yippee {  public static void main(String [] args) {  for(int x = 1; x < args.length; x++) {  System.out.print(args[x] +“ “);  }  }  }  and two separate command line invocations:  java Yippee  java Yippee 1234  What is the result?()
    A

     No output is produced. 123

    B

     No output is produced. 234

    C

     No output is produced. 1234

    D

     An exception is thrown at runtime. 123

    E

     An exception is thrown at runtime. 234

    F

     An exception is thrown at rijntime. 1234


    正确答案: C
    解析: 暂无解析

  • 第21题:

    单选题
    public classYippee{ public static void main(String[]args){ for(intx=1;xSystem.out.print(args[x]+""); } } } and two separate command line invocations:j avaYippee javaYippee1234 What is the result?()
    A

    No output is produced.       123

    B

    No output is produced.        234

    C

    No output is produced.       1234

    D

    An exception is thrown at runtime.        123

    E

    An exception is thrown at runtime.         234

    F

    An exception is thrown at runtime.        1234


    正确答案: E
    解析: 暂无解析

  • 第22题:

    单选题
    Given: What is the result?()
    A

    collie

    B

    harrier

    C

    Compilation fails.

    D

    collie harrier

    E

    An exception is thrown at runtime.


    正确答案: A
    解析: 暂无解析

  • 第23题:

    单选题
    Given: What is the result?()
    A

    test end

    B

    Compilation fails.

    C

    test runtime end

    D

    test exception end

    E

    A Throwable is thrown by main at runtime.


    正确答案: C
    解析: 暂无解析