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:

Verified
Correct Answer:
Verified
Related Questions
Q8: What will be the value of ans
Q10: What is the value of ans after
Q13: When testing for character values, the switch
Q13: What will be the values of ans,
Q14: What would be the value of discountRate
Q15: What would be the value of bonus
Q16: Which of the following will format 12.78
Q16: A block of code is enclosed in
Q17: What will be the values of ans,
Q18: A local variable's scope always ends at