exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 110 discussion

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

Given:

What is the result?

  • A. false, false
  • B. false, true
  • C. true, false
  • D. true, true
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
Community vote distribution
C (100%)

Comments

Chosen Answer:
This is a voting comment. You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Vicky_65
3 months, 3 weeks ago
Selected Answer: C
C is correct
upvoted 1 times
...
akbiyik
8 months ago
Selected Answer: C
Example A: String a = "hello" + " world!"; String b = "hello world!"; boolean compare = (a == b); // This return true Example B: a = "hello"; b = "hel" + "lo"; compare = (a == b); // This return true Example C: a = "Bye"; a += " bye!"; b = "Bye bye!"; compare = (a == b); // This return false System.out.println(compare);
upvoted 4 times
...
carloswork
8 months, 4 weeks ago
Selected Answer: C
Answer is C. To test: public static void main(String[] args) { String str1 = "Java"; String [] str2 = { "J", "a", "v", "a" }; String str3 = ""; for (String str : str2) { str3 = str3 + str; } boolean b1 = (str1.equals(str3)); boolean b2 = (str1==str3); System.out.println(b1+", "+b2); }
upvoted 1 times
...
iSnover
10 months ago
Selected Answer: C
Correct is C, when the equals method is called, the content stored inside the String is analyzed. When the "==" is put it will always give false in case of Strings, because it is not of the primitive type.
upvoted 3 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:
AZ-104
Prague, 1 minute ago