Exam 9: Exception Handling

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

A program can catch multiple exceptions.

(True/False)
4.9/5
(35)

ArrayIndexOutOfBoundsException is a descendent of the class RuntimeException.This means:

(Multiple Choice)
4.8/5
(45)

If a method throws an exception,and the exception is not caught inside the method,then the method invocation:

(Multiple Choice)
4.8/5
(37)

List five common examples of exceptions that occur.

(Essay)
4.8/5
(33)

Try blocks contain code that could possibly:

(Multiple Choice)
4.7/5
(39)

The execution of a throw statement is referred to as:

(Multiple Choice)
4.9/5
(29)

Define an exception class called DiskDriveNotReady.The class should have a constructor with no parameters.If an exception is thrown with this zero-argument constructor,getMessage should return "Disk Drive Not Ready!" The class should also have a constructor with a single parameter of type String.If an exception is thrown with this constructor,then getMessage returns the value that was used as an argument to the constructor.

(Essay)
4.7/5
(27)

When using the Scanner class one should account for a/an:

(Multiple Choice)
4.8/5
(38)

Write a complete Java program that prompts the user for two nonnegative integer numbers.Your program should handle bad input data.

(Essay)
4.7/5
(41)

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

(Multiple Choice)
4.9/5
(26)

A runtime exception is a/an:

(Multiple Choice)
4.8/5
(32)

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

(Essay)
4.9/5
(51)

Every exception class is an ancestor of the class Exception.

(True/False)
4.9/5
(33)

The two most important things about an exception object are its type and the message that it carries in an instance variable of type String.

(True/False)
4.7/5
(31)

Should an application catch objects of type Error?

(Essay)
4.8/5
(33)

A _________ block executes regardless of whether an exception occurs.

(Multiple Choice)
4.8/5
(36)

The compiler does not complain when the catch or declare rule is ignored.

(True/False)
4.8/5
(33)

What is the purpose of the finally block?

(Essay)
4.8/5
(39)

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

(Essay)
4.9/5
(42)

The Exception class belongs to the package:

(Multiple Choice)
4.8/5
(33)
Showing 21 - 40 of 45
close modal

Filters

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