[Logo]
Forums Register Login
Arrays Sorting


If a comparator is not used for sorting, the answer is done,aone,bone,cone.??? What is happening. Shouldnt it sort by its natural order?
It is being sorted according to java.lang.String's natural order. Look carefully at the String " done".
What's that whitespace doing there? What do you suppose the lexicographical order of that character is?
see it is not "done", it is " done" mean space than done.
Ok.thanks.
I am mighty! And this is a mighty small ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss


This thread has been viewed 595 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jul 19, 2018 16:42:05.