Which of the following exceptions are thrown by the JVM?

Which of the following exceptions are thrown by the JVM? (Choose all that apply)

A. ArrayIndexOutOfBoundsException

B. ExceptionInInitializerError

C. java.io.IOException

D. NullPointerException

E. NumberFormatException

Answer:

A, B, D

Explanation:

java.io.IOException is thrown by many methods in the java.io package, but it is always thrown programmatically. The same is true for NumberFormatException; it is thrown programmatically by the wrapper classes of the java.lang package. The other three exceptions are all thrown by the JVM when the corresponding problem arises.

Comments