← all problems

comesBefore 🌶️

Write a method that takes two String parameters, a and b, and returns true if a comes before b in Java's String ordering, and false otherwise (including when the two are equal). Use compareTo.

You do not need an if statement for this; a comparison like x < 0 is already a boolean value, so you can return the comparison itself.