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
Options
- ATrue false
- BTrue null
- CCompilation fails
- DA NullPointerException is thrown at runtime
How the community answered
(32 responses)- A81% (26)
- B13% (4)
- C3% (1)
- D3% (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.
