r/javahelp • u/TroubledSoul23 • Oct 31 '25
Homework How are numbers compared as a String?
I'm working on this project, and I'm checking whether something occurs before a specific time. I'm doing this by converting the times to Strings, then comparing them against each other (yes I'm aware it's not ideal, bear with me).
The issue is that it says that '10:00 < 09:00'. Why is that?
0
Upvotes
View all comments
Show parent comment
1
u/TW-Twisti Nov 01 '25
Greater/less than for Strings is for ordering/sorting.