String.compareTo(): Returns a negative, zero, or positive integer based on lexicographic ordering.
How to apply it: Use compareTo to determine alphabetical order: a negative result means the calling String comes first.
Course: AP Computer Science A · Unit: Using Objects
Practice questions about String.compareTo() on AimFive — get rubric-based feedback showing exactly which points you earned.
AP and Advanced Placement are trademarks of College Board. AimFive is not affiliated with or endorsed by College Board.