File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
OCA/OCP Java SE 7 Programmer I & II Study Guide
this week in the
Programmer Certification (SCJP/OCPJP)
Joined: Apr 04, 2012
May 25, 2012 09:31:03
is this is the right order. refer
natural sort order is lexicographical (Dictionary Sort)
Strings starting with:
Numbers sort first.
Followed by upper case
Followed by lower case.
Joined: Apr 30, 2003
May 25, 2012 14:20:07
List<String> aList = new ArrayList<String>(); System.out.println("before sort:"); aList.add("1234"); aList.add("12"); aList.add("9"); aList.add("abcd"); aList.add("ABCD"); aList.add(" abc"); System.out.println(aList); System.out.println("after sort:"); Collections.sort(aList); System.out.println(aList);
[1234, 12, 9, abcd, ABCD, abc]
[ abc, 12, 1234, 9, ABCD, abcd]
Joined: Jul 09, 2001
May 26, 2012 14:22:05
Right, according to the
ASCII characters 0 to 127
or more generally based on the Unicode order.
William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: general doubt?
Help needing in using Comparator to sort BY multiple elements in ArrayList
doubt in Mikalai notes in overiding deployment descriptor
Collections - sort
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014