i have done this by doing a toArray() on the linked list and then using compareto() for every element in the array, can this be done without using arrays? can i sort this ArrayList of strings only using the Collection class methods?
Originally posted by Shraddha Jain: oh yes! tried this now. but i see there's a method sort(list l ,Comparator c) can i specify how i want sort() to compare objects in the arraylist? using this method?
Collection.sort(List list)will sort in natural order. sort(List list, Comparator c), The the comparator to determine the order of the list.All elements in the list must be mutually comparable.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com