exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 85 discussion

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

Given:

And given the commands:

What is the result?

  • A. 1 null
  • B. true false
  • C. false false
  • D. true true
  • E. A ClassCastException is thrown at runtime.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
BelloMio
1 month, 2 weeks ago
boolean valueOf(string s) The Boolean returned represents a true value if the string argument is not null and is equal, ignoring case, to the string "true" https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html#valueOf-boolean- Which means it returns false when a string is equal to "1"
upvoted 1 times
...
dsms
11 months, 1 week ago
answer is: false false
upvoted 1 times
...
winfred_lu
1 year ago
Selected Answer: C
false false
upvoted 1 times
...
Vicky_65
1 year, 3 months ago
Selected Answer: C
C is the correct answer
upvoted 1 times
...
akbiyik
1 year, 7 months ago
java Test 1 null 1 and null are Strings because args type is String[]. public static Boolean valueOf(String s) { return parseBoolean(s) ? TRUE : FALSE; } If the specified boolean is true, then the string "true" will be returned, otherwise the string "false" will be returned. In this case, if the value is not true, all other String values return false.
upvoted 1 times
...
anmoldev2java
1 year, 8 months ago
Selected Answer: C
c is ans
upvoted 1 times
...
carloswork
1 year, 9 months ago
Selected Answer: C
Answer is C. Remember to run in command line "java Test 1 null". boolean a = new Boolean(Boolean.valueOf(args[0])); boolean b = new Boolean(args[1]); System.out.println( a + " " + b );
upvoted 1 times
...
iSnover
1 year, 9 months ago
Selected Answer: C
Correct is C, The default valor of a boolean type is false. When the valor is null, in boolean case, it is automatically transformed into false. In the line 2, as the boolean value was not started, so it is false too. Answer False False.
upvoted 4 times
...
Joker74
1 year, 10 months ago
Selected Answer: C
if we pass other then true(equals ignore case) as a Boolean argument then it is referred as false.
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