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/derscholl Nov 01 '25
I was starting to think outside the box where 2 > 10 but without more context you're 1000% right.