title: Difference between Iterator and Listiterator?
body: <pre><code>Iterator ite = Set.iterator();
  Iterator ite = List.iterator();
  
  ListIterator listite = List.listIterator();
  </code></pre>
  
  <p>We can use <code>Iterator</code> to traverse a <code>Set</code> or a <code>List</code> or a <code>Map</code>. But <code>ListIterator</code> can only be used to traverse a <code>List</code>, it can't traverse a <code>Set</code>. Why?</p>
  
  <p>I know that the main difference is that with iterator we can travel in only one direction but with <code>ListIterator</code> we can travel both directions. Are there any other differences? And any advantages of <code>ListIterator</code> over <code>Iterator</code>?</p>