Question 8
Back to Exercise
What does "apple".compareTo("banana") return?
- A A positive number
- B A negative number Correct
- C 0
- D true
Correct Answer: Option B
"apple" comes before "banana": 'a' − 'b' = -1.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!