Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As per the <a href="http://java.sun.com/javase/6/docs/api/java/util/Vector.html" rel="nofollow noreferrer">API docs</a>, <code>Vector</code> just implements <code>List</code>, so I don't forsee problems. Maybe your confusion was caused because you declared <code>Vector</code> according the old Java 1.0 style:</p> <pre><code>Vector vector = new Vector(); </code></pre> <p>instead of the declaring it aginst the interface (which is considered good practice):</p> <pre><code>List list = new Vector(); </code></pre> <p>You can thus just make use of <a href="http://java.sun.com/javase/6/docs/api/java/util/Collections.html#sort%28java.util.List%29" rel="nofollow noreferrer"><code>Collections#sort()</code></a> to sort a collection, <a href="http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html" rel="nofollow noreferrer"><code>Comparable</code></a> to define the default ordering behaviour and/or <a href="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html" rel="nofollow noreferrer"><code>Comparator</code></a> to define an external controllable ordering behaviour.</p> <p>Here's a <a href="http://java.sun.com/docs/books/tutorial/collections/interfaces/order.html" rel="nofollow noreferrer">Sun tutorial</a> about ordering objects.</p> <p>Here's another <a href="https://stackoverflow.com/questions/1814095/sorting-an-arraylist-of-contacts/1814112#1814112">SO answer</a> with complete code examples.</p> <p>That said, why are you still sticking to the <em>legacy</em> <code>Vector</code> class? If you can, just replace by the improved <a href="http://java.sun.com/javase/6/docs/api/java/util/ArrayList.html" rel="nofollow noreferrer"><code>ArrayList</code></a> which was been designed as replacement of <code>Vector</code> more than a decade ago.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload