nerdexam
Oracle

1Z0-815 · Question #50

Given: What is the result?

The correct answer is A. True false. With the statement "bool[1] = new Boolean(null);" we are creating a wrapped Boolean object with Java evaluates it to false since it cannot evaluate to true;

Working with Java Primitive Data Types and String APIs

Question

Given:

What is the result?

Exhibit

1Z0-815 question #50 exhibit

Options

  • ATrue false
  • BTrue null
  • CCompilation fails
  • DA NullPointerException is thrown at runtime

How the community answered

(32 responses)
  • A
    81% (26)
  • B
    13% (4)
  • C
    3% (1)
  • D
    3% (1)

Explanation

With the statement "bool[1] = new Boolean(null);" we are creating a wrapped Boolean object with Java evaluates it to false since it cannot evaluate to true;

Topics

#String comparison#boolean output#null handling#autoboxing

Community Discussion

No community discussion yet for this question.

Full 1Z0-815 Practice