Java Exceptions  «Prev  Next»

Handling Java Exceptions - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 

1. Which one of the following classes is associated with a normal exception, as opposed to a runtime exception?
Please select the best answer.
  A. FileNotFoundException
  B. IndexOutOfBoundsException
  C. ArithmeticException

2. Using the try-catch construct, you place the code that can potentially throw an exception in:
Please select the best answer.
  A. A catch block
  B. The finally block
  C. The try block


3. What method do you call on an Exception object to print the call stack associated with the exception?
Please select the best answer.
  A. printStackTrace()
  B. printCallStack()
  C. printTraceStack()

4. What is commonly referred to as an exception handler?
Please select the best answer.
  A. A catch clause
  B. The try clause
  C. The throws clause in a method declaration


Your score is 0.0