title: How to use compareTo for generics. (<E>, <Integer>...)
body: <p>I need to use compareTo() in program given by my profesor.
  But that program includes generics. And there is problem with that function. So my question is how can i implement it.</p>
  
  <pre><code>if(node1.getElement().compareTo(node2.getElement()) &lt; 0)
  </code></pre>
  
  <p>And i need some explanation for <code>java.util.Iterator;</code>
  Because i need to use <code>iteration()</code> in the main class.
  I am new to java. Be free to explain it to a newbie. Tnx guys</p>
  
  <p>here is the wholeeeeeee code :D
  <a href="https://pastebin.com/mA9igb1t" rel="nofollow noreferrer">https://pastebin.com/mA9igb1t</a></p>