Exam 11: Handling Exceptions and Events

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which of the following inputs would be caught by the second catch block in the program in the accompanying figure?

Free
(Multiple Choice)
4.9/5
(42)
Correct Answer:
Verified

C

During program execution, if division by zero occurs with integer values and is not addressed by the program, then the program terminates with an error message indicating an attempt to divide by zero.

Free
(True/False)
4.9/5
(38)
Correct Answer:
Verified

True

NoSuchElementException is a method of the class Exception.

Free
(True/False)
4.8/5
(38)
Correct Answer:
Verified

False

A message is returned by which method of an Exception object?

(Multiple Choice)
4.8/5
(40)

If you have created an exception class, you can define other exception classes extending the definition of the exception class you created.

(True/False)
4.7/5
(34)

Which of the following is NOT a typical action of the catch block?

(Multiple Choice)
4.9/5
(34)

The class Exception and its subclasses are designed to catch exceptions that should be caught and processed during program execution.

(True/False)
4.9/5
(43)

The class RuntimeException is the superclass of which of the following classes?

(Multiple Choice)
4.8/5
(41)

If an exception occurs in a try block and that exception is caught by a catch block, then the remaining catch blocks associated with that try block are ignored.

(True/False)
4.8/5
(33)

A checked exception is any exception checked for by the programmer.

(True/False)
4.7/5
(33)

The StringIndexOutOfBoundsException could be thrown by the method parseInt of the class Integer.

(True/False)
4.8/5
(49)

Which of the following methods prints a list of the methods that were called before the exception was thrown?

(Multiple Choice)
4.8/5
(27)

Which of the following exceptions might be thrown by the methods of the class String?

(Multiple Choice)
4.9/5
(28)

Statements that might generate an exception are placed in a catch block.

(True/False)
4.9/5
(34)

What happens in a method if there is an exception thrown in a try block but there is no catch block following the try block?

(Multiple Choice)
4.8/5
(45)

Which of the following statements is true?

(Multiple Choice)
4.9/5
(29)

The class RuntimeException is part of the package java.io.

(True/False)
4.9/5
(48)

Which exception-handling technique is the code in the accompanying figure using?

(Multiple Choice)
4.8/5
(40)

Which of the following statements is NOT true about creating your own exceptions?

(Multiple Choice)
4.8/5
(45)

If you have a reference to an exception object, you can use the reference to throw the exception.

(True/False)
4.9/5
(38)
Showing 1 - 20 of 50
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)