Filters
Question type

Study Flashcards

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


A) Checked exceptions
B) Unchecked exceptions
C) Fatal exceptions
D) All of the above

E) B) and C)
F) C) and D)

Correct Answer

verifed

verified

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:


A) Exception handler
B) Throws clause
C) Try block
D) Catch block

E) A) and C)
F) A) and B)

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

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.

Correct Answer

verifed

verified

public class FileNotFoundExcep...

View Answer

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

Correct Answer

verifed

verified

throw new ...

View Answer

Showing 41 - 45 of 45

Related Exams

Show Answer