Solved

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

Question 12

Multiple Choice

If str1 and str2 are both Strings, which of the following will correctly test to determine whether str1 is less than str2?
(1) (str1 < str2)
(2) (str1.equals(str2) < 0)
(3) (str1.compareTo(str2) < 0)


A) 1, 2, and 3 will all work
B) 2
C) 3
D) 2 and 3

Correct Answer:

verifed

Verified

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

Related Questions