Java OCA OCP Practice Question 1052

Question

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


A, B, D.

Note

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 java.lang.

The other three exceptions are all thrown by the JVM when the corresponding problem arises.




PreviousNext

Related