Java Exceptions  «Prev  Next»

Java Exception Basics - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 
1. Which of the following occurrences fails to qualify as an exception?
Please select the best answer.
  A. A file is not found.
  B. A network connection fails.
  C. An infinite loop is entered.

2. What standard class is derived from Throwable and serves as the base class for normal Java exceptions?
Please select the best answer.
  A. RuntimeException
  B. Exception
  C. Error



3. How do you indicate that the code in a method is capable of throwing an exception?
Please select the best answer.
  A. Use the throw keyword.
  B. Use the throws keyword.
  C. Create an Exception object and return it from the method.


Your score is 0.0
C
B
B