The answer is letter B, you can finish by eliminating the others that are very wrong. There's no way to be A or C because the first line of the 2 answers makes an operation useless because String is immutable, you would have to assign the operation to a variable. The letter D is wrong because you don't compare a String with "==", because String is not a primitive variable and even being equal it will give false, to get around this you have to use the "equals" method that will compare the substrings of the String, which is what is done in answer B.
upvoted 1 times
...
Log in to ExamTopics
Sign in:
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.
DriftKing
3 months, 3 weeks agocarloswork
1 year, 2 months agoiSnover
1 year, 3 months ago