Exam 9: Exception Handling

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

Try blocks contain code that could possibly:

Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
Verified

B

Write a Java statement that throws a new exception with the String: Disk drive not ready.

Free
(Essay)
4.7/5
(43)
Correct Answer:
Verified

throw new Exception"Disk Drive Not Ready!");

The finally block contains code to be executed whether or not an exception is thrown in a try block.

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

True

Write a Java statement that throws a new exception with the String: File Not Found.

(Essay)
4.8/5
(36)

Every exception class is an ancestor of the class Exception.

(True/False)
4.7/5
(38)

Revise the program in number 9 above to throw a NegativeNumberException if the user enters a negative number.

(Essay)
4.9/5
(38)

Revise the program in number 8 above to use a try/catch block to handle the IOException.

(Essay)
4.8/5
(45)

When defining your own exception class,you extend an existing exception class.This is an example of:

(Multiple Choice)
4.9/5
(39)

Which circumstance is an exception to the catch or declare rule?

(Multiple Choice)
5.0/5
(32)

A ___________ block should immediately follow a try block.

(Multiple Choice)
4.9/5
(31)

The throw operator causes a change in the flow of control.

(True/False)
4.7/5
(32)

Exceptions that must follow the Catch or Declare Rule are often called unchecked exceptions.

(True/False)
4.9/5
(30)

A _________ block executes regardless of whether an exception occurs.

(Multiple Choice)
4.8/5
(36)

A program can catch multiple exceptions.

(True/False)
4.9/5
(35)

Exceptions that are subject to the catch or declare rule are called:

(Multiple Choice)
4.8/5
(39)

What is the catch or declare rule?

(Essay)
4.8/5
(36)

What is the purpose of the finally block?

(Essay)
4.8/5
(33)

Exception handling is an example of a programming methodology known as:

(Multiple Choice)
4.9/5
(38)

Use a catch block to display the exception thrown in number one above.

(Essay)
4.7/5
(43)

The Exception class belongs to the package:

(Multiple Choice)
4.8/5
(40)
Showing 1 - 20 of 45
close modal

Filters

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