exam questions

Exam 1z0-808 All Questions

View all questions & answers for the 1z0-808 exam

Exam 1z0-808 topic 1 question 70 discussion

Actual exam question from Oracle's 1z0-808
Question #: 70
Topic #: 1
[All 1z0-808 Questions]

Given:

What is the result?

  • A. True false
  • B. True null
  • C. Compilation fails
  • D. A NullPointerException is thrown at runtime
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
v323rs
Highly Voted 4 years ago
the correct answer A. True false
upvoted 13 times
...
Rdharma
Most Recent 7 months, 2 weeks ago
Selected Answer: A
A is the answer
upvoted 1 times
...
Vicky_65
10 months, 1 week ago
Selected Answer: A
A is correct
upvoted 1 times
...
carloswork
1 year, 3 months ago
Selected Answer: A
Tested. Answer is A. Source code: public static void main(String[] args) { Boolean[] bool = new Boolean[2]; bool[0] = new Boolean(Boolean.parseBoolean("true")); bool[1] = new Boolean(null); System.out.println(bool[0] + " " + bool[1]); }
upvoted 1 times
...
BhushahK
2 years, 9 months ago
Correct Answer - A (True, False) - tested
upvoted 1 times
...
this_nickname
3 years, 6 months ago
new Boolean(null) will call the construcor : public Boolean(String s) { this(parseBoolean(s)); } public static boolean parseBoolean(String s) { return ((s != null) && s.equalsIgnoreCase("true")); } So the returned value will be false. The answer is A
upvoted 4 times
...
auroravismara
3 years, 7 months ago
Correct answer is B. tested -> True null in console Boolean[] x = new Boolean[2]; x[0] = new Boolean(Boolean.parseBoolean("true")); x[1] = null; System.out.println(x[0] + " " + x[1]);
upvoted 1 times
levilevi
3 years, 6 months ago
given is: x[1] = new Boolean(null); and it prints true false. checked
upvoted 3 times
...
...
mete23
4 years ago
The correct answer A.
upvoted 4 times
...
letmein2
4 years, 5 months ago
by default anything else is a false. private static boolean toBoolean(String name) { return ((name != null) && name.equalsIgnoreCase("true")); }
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago