CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 1999
    Location
    Dortmund, Germany
    Posts
    21

    How to sort objects within a Vector?

    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


  2. #2
    Join Date
    Jan 2000
    Location
    CA, USA
    Posts
    305

    Re: How to sort objects within a Vector?

    You can use the Sort class and use its quicksort
    method.

    Kannan



  3. #3
    Join Date
    Aug 1999
    Location
    San Diego
    Posts
    155

    Re: How to sort objects within a Vector?

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured