Solved

If Str1 and Str2 Are Both Strings, Which of the Following

Question 34

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions