title: Java: using TreeSet
body: <p>I want to go over the objects inside my <code>TreeSet</code>, I can do it by making an array using <code>toArray</code> but I don't need to go over all of the objects in the Set.</p>
  
  <p>How can I go over the objects in the Set (starting with the first than the second etc') ?</p>
  
  <p>And another small question about <code>TreeSet</code> : Can I keep the objects in the <code>TreeSet</code> sorted (so the first object will be with the smallest key etc') ?</p>
  
  <p>edit: say I have a class myInt (with int myInteger) and I want to use it in TreeSet with a different oredering than the natural one, what do I need to define in my class (myInt) to do this ?</p>