Multiple Choice
If str1 and str2 are both Strings, which of the following expressions will correctly determine whether they are equal?
(1) (str1 == str2)
(2) str1.equals(str2)
(3) (str1.compareTo(str2) == 0)
A) 1, 2, and 3 will all work
B) 1 and 2
C) 1 and 3
D) 2 and 3
Correct Answer:

Verified
Correct Answer:
Verified
Related Questions
Q30: Which of the following is the correct
Q32: The if/else statement will execute one group
Q33: These operators use two operands:<br>A) Unary<br>B) Binary<br>C)
Q34: In a switch statement, each of the
Q35: A Boolean expression is one that is
Q36: Which one of the following is the
Q37: What will be the value of x
Q38: Because the && operator performs short-circuit evaluation,
Q39: If chr is a character variable, which
Q44: Which of the following expressions will determine