nerdexam
Oracle

1Z0-803 · Question #93

Which two are Java Exception classes?

The correct answer is A. SercurityException C. IllegalArgumentException. Assuming 'SercurityException' is a typo for SecurityException, both SecurityException and IllegalArgumentException are standard unchecked exceptions within the core Java API.

Handling Exceptions

Question

Which two are Java Exception classes?

Options

  • ASercurityException
  • BDuplicatePathException
  • CIllegalArgumentException
  • DTooManyArgumentsException

How the community answered

(65 responses)
  • A
    86% (56)
  • B
    9% (6)
  • D
    5% (3)

Why each option

Assuming 'SercurityException' is a typo for `SecurityException`, both `SecurityException` and `IllegalArgumentException` are standard unchecked exceptions within the core Java API.

ASercurityExceptionCorrect

`SecurityException` is a standard unchecked exception (subclass of `RuntimeException`) in Java's `java.lang` package, thrown to indicate a security violation. (Assuming "SercurityException" is a typo for "SecurityException").

BDuplicatePathException

`DuplicatePathException` is not a standard Java exception class found in the core Java API.

CIllegalArgumentExceptionCorrect

`IllegalArgumentException` is a standard unchecked exception (subclass of `RuntimeException`) in Java's `java.lang` package, thrown to indicate that a method has received an illegal or inappropriate argument.

DTooManyArgumentsException

`TooManyArgumentsException` is not a standard Java exception class found in the core Java API.

Concept tested: Standard Java exception classes

Source: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/SecurityException.html

Topics

#exception types#RuntimeException#IllegalArgumentException

Community Discussion

No community discussion yet for this question.

Full 1Z0-803 Practice