nerdexam
Oracle

1Z0-804 · Question #127

Given: What is the result?

The correct answer is E. Compilation fails. error: incompatible types e = new Exception(); required: RuntimeException found: Exception

Exceptions and Assertions

Question

Given:

What is the result?

Exhibit

1Z0-804 question #127 exhibit

Options

  • ANull
  • Bclass java.lang.ArraylndexOutOfBoundsException
  • Cclass java.lang.NullPointerException
  • Dclass java.lang.Exception
  • ECompilation fails.

How the community answered

(38 responses)
  • A
    3% (1)
  • B
    3% (1)
  • C
    13% (5)
  • D
    8% (3)
  • E
    74% (28)

Explanation

error: incompatible types e = new Exception(); required: RuntimeException found: Exception

Topics

#exception handling#null pointer#compilation#exception types

Community Discussion

No community discussion yet for this question.

Full 1Z0-804 Practice