Click to See Complete Forum and Search --> : How to sort objects within a Vector?


JvW
March 3rd, 2000, 08:42 AM
Hallo!

Can someone tell me how to sort the objects in a vector?
Do I have to implement a QuickSort, BubbleSort, etc. to do this or is there a nice way in Java?

Kind regards,
Jochen, Germany

kannanbalu
March 3rd, 2000, 01:25 PM
You can use the Sort class and use its quicksort
method.

Kannan

DHunter21
March 3rd, 2000, 01:46 PM
I don't know what exactly your doing, but you may want to consider looking at the Collections package. If you use TreeSet or TreeMap (which operate much like Hashtable) then the entries are automatically sorted according to the key.

Dustin