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
Q28: To do a case insensitive compare which
Q29: In an if/else statement, if the boolean
Q30: The expression tested by an if statement
Q31: What would be the value of discountRate
Q32: What is the value of ans after
Q34: This is a boolean variable that signals
Q35: What would be the value of x
Q36: These operators use two operands:
A) Unary
B) Binary
C)
Q37: What would be the value of discountRate
Q38: What is the value of x after
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents