Exam 9: Exception Handling

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

You can not place a try block and its following catch blocks inside a larger try block or inside a larger catch block.

(True/False)
4.8/5
(32)

In event-driven programming,sending an event is called firing the event.

(True/False)
4.9/5
(35)

What is the purpose of the method getMessage)when used with exception handling?

(Essay)
4.9/5
(34)

The execution of a throw statement is referred to as:

(Multiple Choice)
4.8/5
(31)

If a method does not catch an exception,then it must at least warn programmers that any invocation of the method might possibly throw an exception.This warning is called a/an:

(Multiple Choice)
4.8/5
(42)

List five common examples of exceptions that occur.

(Essay)
4.8/5
(37)

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

(Essay)
5.0/5
(37)

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.9/5
(33)

Define an exception class called FileNotFoundException.The class should have a constructor with no parameters.If an exception is thrown with this zero-argument constructor,getMessage should return "File Not Found!" 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.8/5
(40)

Methods that process String arguments as if they were numbers could possibly throw a/an _________ exception.

(Multiple Choice)
4.8/5
(32)

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

(Multiple Choice)
4.7/5
(38)

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

(Multiple Choice)
4.9/5
(34)

All exceptions are descendants of the class:

(Multiple Choice)
4.9/5
(37)

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.8/5
(37)

The basic way of handling exceptions in Java consists of the try-catch-throw trio.

(True/False)
4.8/5
(36)

An exception is caught in a _________ block.

(Multiple Choice)
4.9/5
(39)

Should an application catch objects of type Error?

(Essay)
4.7/5
(47)

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

(Multiple Choice)
4.8/5
(46)

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

(Essay)
4.9/5
(45)

The catch block has ________ parameters.

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

Filters

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