title: How can I use a custom class in a TreeSet?
body: <p>If I was using a <code>Set</code> similar to this:</p>
  
  <pre><code>Set&lt;node&gt; s=new TreeSet&lt;node&gt;();
  
  class node {
  
    private int x;
    private int y;
  
  }
  </code></pre>
  
  <p>Would this be acceptable, and since it's a TreeSet, would it also sort it?</p>