Java Comparable issue
<p>I want to sort objects by a string they have. Just wondering does this make sense?
Before now I have only used <code>Arrays.sort(BlahList);</code> But now I could have many objects and not just an arraylist of strings.</p>

<pre><code>public class Contact implements Comparable
{
    private string name;

    public compareTo (Contact Contact1)
    {
        return this.name.compareTo(Contact1.name);
    }
}
</code></pre>

<p>and in the main method I have:</p>

<pre><code>Collections.sort(ContactList);
</code></pre>

<p>I would also like to know if this would work for integers if the name was age?</p>
