Hi, you could investigate the java.util.Arrays or java.util.Collections APIs. They have various methods for performing sorting on arrays or lists. I tried the following code:
When run under windows, the File is already sorted for you, but when run under Unix I needed to add the call to Arrays.sort(Object). If the desired sorting isn't what you are after then you will have to define your own custom sorting by implementing Comparator and calling something like Arrays.sort(Object myArray, Comparator myComparator). James.
posted 16 years ago
Thanks for your reply. I got the alphabetically sorted list by using Arrays.sort(Object) Thanks again
A teeny tiny vulgar attempt to get you to buy our stuff
Thread Boost - a very different sort of advertising