Practice mode Java

Which keyword appears in a Java method header to declare the exceptions the method may throw?

Correct answer D. throws

Explanation

The throws clause in a method header lists checked exceptions that callers must deal with. The similar word throw is a statement that actually raises an exception object inside the body. The catch and finally keywords form parts of a try statement. Declaring unchecked exceptions in throws is permitted, but the compiler does not require it.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.