I have these strings in an ArrayList of String in no particular order but when I invoke Collections.sort(listReference), the sorted result is incorrect, why do 10 and 11 (the last 2 characters) come before 07, 08, 09?
12880 20090506054200001
12880 20090506054200002
12880 20090513070200003
12880 20090513070200004
12880 20090520202600005
12880 20090520202600006
12880 20090520232900010
12880 20090520232900011
12880 20090520232900007
12880 20090520232900008
12880 20090520232900009
It works fine for me:
Output:
Are you absolutely sure that your 7/8/9 entries don’t have something “odd” in them elsewhere (e.g. a different element of whitespace between 12880 and the timestamp)?
If not, can you produce a short but complete program that demonstrates the problem?