exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 50 discussion

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

Given the code fragment:

Which code fragment, when inserted at line n1, enables the App class to print Equal?

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
kkaayyyy
Highly Voted 1 year, 3 months ago
B is the correct option because == operator checks the same address and as str1 and str2 have different addresses but same content.
upvoted 5 times
...
fvelazqueznava
Most Recent 3 months, 1 week ago
Selected Answer: B
Rembember the strings are immutable
upvoted 1 times
...
DriftKing
4 months, 2 weeks ago
Selected Answer: B
public class App { public static void main (String[] args) { String str1 = "Java"; String str2 = new String("java"); if(str2.equals(str1.toLowerCase())) { System.out.println("Equal"); } else { System.out.println("Not Equal"); } } }
upvoted 1 times
...
Sreeni_A
5 months ago
B is correct
upvoted 1 times
...
Kolodets
8 months, 3 weeks ago
A is wrong. The new value is not assigned to str1
upvoted 1 times
...
Vicky_65
9 months, 2 weeks ago
Selected Answer: B
B is correct
upvoted 1 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