- Oct 30, 2000
- 14,665
- 440
- 126
Okay, I'm using a few Vectors in my code and I need to sort a few of them. To make it simple I was using the .toArray() method since a Vector inherents it from the Collection class. Then I can use the .sort() method that Arrays have. Then I put what I sorted back into the Vector. I could make my own recursive method with for loops to traverse the Vector list and do a bubble or swap sort or something like that. But why bother when it's already been done?
Anyhow, my boss tells me there is a sort method already done for the Collection class. I can't find it anywhere in the Java docs on java.sun.com. He's not here today to ask what he was talking about.
Anyone know if there is a way to sort Vectors from a Collection's method?
Anyhow, my boss tells me there is a sort method already done for the Collection class. I can't find it anywhere in the Java docs on java.sun.com. He's not here today to ask what he was talking about.
Anyone know if there is a way to sort Vectors from a Collection's method?