Hi All! Please help!! I have a vector which holds String objects. I need to sort these strings in descending order. I read the docs and I gather that I have to use the Collections interface. I also read this previous thread: http://www.javaranch.com/ubb/Forum34/HTML/001752.html and I'm still confused about using a Comparator. Please provide code to do this if you have time. I would do it for you if the situation was reversed. Thanks in advance. Ernie
In a time of drastic change it is the learners who inherit the future. The learned usually find themselves equipped to live in a world that no longer exists.<br />Eric Hoffer
Not the java.util.Collection Interface, but the java.util.CollectionsClass. (confusing, isn't it?) The interface defines some behaviour for all classes that fit in the Collections Framework, the class defines some helper functionality for doing some common things easily. A Comparator defines how to create an absolute ordering of another class type, but since a String already has an absolute order (namely alphabetical order ) you don't have to re-invent anything. Collections has a sort(List) method, and a Vector is a List so you can pass it in and the Vector will be sorted (in one line of code!) You can either iterate through the Vector backwards, or pass the Vector to the Collections.reverse(List) and it will pass the reversed list to you. Two lines of code! Dave.