You are on page 1of 2

An exception in Java is an ___________ event that disrupts the normal flow of program execution.

Answer: unexpected

Exceptions can occur at ___________ time during the execution of a Java program.

Answer: runtime

The base class for all Java exceptions is ___________.

Answer: Throwable

Checked exceptions must be ___________ or handled using a try-catch block.

Answer: declared (in the method signature)

The catch block is used to ___________ exceptions that are thrown by the preceding try block.

Answer: handle

The finally block is executed ___________ whether an exception occurs or not.

Answer: always

To throw a custom exception, you can create a new class that extends ___________.

Answer: Exception (or any subclass of Exception)

The throws clause is used in a method signature to ___________ that the method may throw certain
exceptions.
Answer: declare

You can use multiple catch blocks to handle ___________ types of exceptions in different ways.

Answer: different

The try-with-resources statement is used for ___________ resources that need to be closed after
use.

Answer: automatically closing

You might also like