Vector sorting

Is there a way of sorting a Vector of Strings. For instance, if it is already sorted and i add another element to the end of the Vector, is there a command i can use to sort it.Should i be using a Dictionary or Hashtable or something?
[255 byte] By [hande123] at [2007-9-26 4:12:24]
# 1
I don't think so. To have auto-sorting, you can use Set or TreeMap. Check out the Collection framework for a data structure that fits you the best.
ken0624700 at 2007-6-29 13:18:15 > top of Java-index,Archived Forums,Java Programming...
# 2
Vector v = new Vector();v.add("Sorting");v.add("Makes");v.add("Java's Collections package");v.add("Trivial");Collections.sort(v);
schillj at 2007-6-29 13:18:15 > top of Java-index,Archived Forums,Java Programming...
# 3
Every time you add a String, just call the Collections.sort() method
schillj at 2007-6-29 13:18:15 > top of Java-index,Archived Forums,Java Programming...