• Post Reply Bookmark Topic Watch Topic
  • New Topic

sorting numbers with java.util.vector pls help?  RSS feed

 
Kirill N
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am quite new at this, basically want I want to do is sort a bunch of numbers using the vector in java.util can anyone help me, or give me some basic pointers, advice, anything I will appreciate it. Thanx.
 
Angela Lamb
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the sort method in java.util.Collections. You can either use objects that implement the Comparable interface, or pass in a Comparator object as one of the parameters.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Kirill N",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in again with a new name which meets the requirements.
Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!