列举三个常见的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
第3题:
Which the statement is true?()
第4题:
关于异常,以下说法正确的有()。
第5题:
Which step can be used to trap runtime script errors and recover gracefully?()
第6题:
public class TestOne { public static void main (String[] args) throws Exception { Thread.sleep(3000); System.out.println(”sleep”); } } What is the result?()
第7题:
The Error class is a Runtime Exception.
No exceptions are subclasses of Error.
Any statement that may throw an Error must be enclosed in a try block.
any statement that may throw an Exception must be enclosed in a try block.
Any statement that may throw an Runtime Exception must be enclosed in a try block.
第8题:
运行时异常使用Runtime Exception的子类来表示,不用在可能抛出异常的方法声明上加throws子句
运行时异常使用Runtime Exception的子类来表示,必须在可能抛出异常的方法声明上加throws子句
非运行期异常是从Exception继承而来的,必须在方法声明上加throws子句
非运行期异常是从Exception继承而来的,不需要在方法声明上加throws子句
第9题:
peep
bark
meow
Compilation fails.
An exception is thrown at runtime.
第10题:
第11题:
Afoo Afoo
Afoo Bfoo
Bfoo Afoo
Bfoo Bfoo
Compilation fails.
An exception is thrown at runtime.
第12题:
7
49
343
Compilation fails.
An exception is thrown at runtime.
第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?()
第15题:
public class Yippee2{ stati cpublic void main(String[]yahoo){ for(intx=1;x
第16题:
以下哪四个能使用throw抛出?()
第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?()
第18题:
42
420
462
42042
Compilation fails.
An exception is thrown at runtime.
第19题:
An exception is thrown at runtime.
int Long
Compilation fails.
Short Long
第20题:
No output is produced. 123
No output is produced. 234
No output is produced. 1234
An exception is thrown at runtime. 123
An exception is thrown at runtime. 234
An exception is thrown at rijntime. 1234
第21题:
No output is produced. 123
No output is produced. 234
No output is produced. 1234
An exception is thrown at runtime. 123
An exception is thrown at runtime. 234
An exception is thrown at runtime. 1234
第22题:
collie
harrier
Compilation fails.
collie harrier
An exception is thrown at runtime.
第23题:
test end
Compilation fails.
test runtime end
test exception end
A Throwable is thrown by main at runtime.