Loading

Q1.

Which class is the root of the exception hierarchy in Java?

A. Exception

B. Error

C. Throwable 

D. RuntimeException

Q2.

Which of the following is a checked exception?

A. NullPointerException

B. IOException 

C. ArithmeticException

D. ArrayIndexOutOfBoundsException

Q3.

Which of these belongs to the Error class hierarchy?

A. SQLException

B. OutOfMemoryError
C. NumberFormatException

D. IOException

Q4.

Which statement about RuntimeException is correct?

A. It is a checked exception

B. It must always be declared in method signature

C. It is an unchecked exception 

D. It cannot be thrown by JVM

Q5.

Which statement is TRUE about Exception hierarchy?

A. All exceptions are errors

B. All errors are exceptions

C. Both exceptions and errors inherit from Throwable
D. Throwable is a subclass of Exception