nerdexam
Oracle

1Z0-803 · Question #49

An unchecked exception occurs in a method dosomething() Should other code be added in the dosomething() method for it to compile and execute?

The correct answer is D. No other code needs to be added.. According to Oracle, the Java programming language does not require methods to catch or to specify unchecked exceptions (RuntimeException, Error, and their subclasses).

Handling Exceptions

Question

An unchecked exception occurs in a method dosomething() Should other code be added in the dosomething() method for it to compile and execute?

Options

  • AThe Exception must be caught
  • BThe Exception must be declared to be thrown.
  • CThe Exception must be caught or declared to be thrown.
  • DNo other code needs to be added.

How the community answered

(54 responses)
  • A
    2% (1)
  • B
    4% (2)
  • C
    2% (1)
  • D
    93% (50)

Explanation

According to Oracle, the Java programming language does not require methods to catch or to specify unchecked exceptions (RuntimeException, Error, and their subclasses).

Topics

#unchecked exceptions#exception handling#throws clause

Community Discussion

No community discussion yet for this question.

Full 1Z0-803 Practice