File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes how to sort out elements in vector objects Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "how to sort out elements in vector objects" Watch "how to sort out elements in vector objects" New topic
Author

how to sort out elements in vector objects

senthil sen
Ranch Hand

Joined: Oct 10, 2002
Posts: 182
how to sort out elements in vector objects?
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Look at Collections.sort(). If the elements implement Comparable then you can just do this:

If not then you can provide a Comparator like this:


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to sort out elements in vector objects
 
Similar Threads
Java Vector
Vectors vs Arrays
order of elements in Vector
Sort vector contennts
Class Cast Exception - Please help