Sorting a List
// Create a list
String[] strArray = new String[] {"z", "a", "C"};
List list = Arrays.asList(strArray);
// Sort
Collections.sort(list);
// C, a, z
// Case-insensitive sort
Collections.sort(list, String.CASE_INSENSITIVE_ORDER);
// a, C, z
// Reverse-order sort
Collections.sort(list, Collections.reverseOrder());
// z, a, C
// Case-insensitive reverse-order sort
Collections.sort(list, String.CASE_INSENSITIVE_ORDER);
Collections.reverse(list);
// z, C, a
good , Is better of think source code in java
THIS IS AWESOME...the most resourceful site i've ever visited. thanks
AAAAAAAAAAAAAAAAAAAAAAH HOW DO U DO BUBBLE SORT OR SELECTION SORT!
I just want to be able to sort a list alphabetically on a notepad. I don't know how to use the codes or where to put them (don't be rude :D)to make a program work.
This is actually sorting an array, not a list. Does anyone know how to sort a linked list?
puto
puto
thanks it helped me a lot
I feel strongly about information and love learning more on this. If possible, as you gain expertise, It is extremely helpful for me. would you mind updating your blog with more information?