title: How to make a list iterator that starts at the end of the list
body: <p>I have a homework question that asks me to make a list iterator that starts at the end of the list. I have no idea how to do this. Here is the code</p>
  
  <pre><code>public class LinkedListTester7
  {
      public static void main(String [] args)
      {
          LinkedList&lt;Integer&gt; list = new LinkedList&lt;Integer&gt;();
          for (int i = 0 ; i &lt; 100 ; i = i + 2)
              list.add(i) ;
          //-----------Start below here. To do: approximate lines of code = 3
          // 1. make a list iterator that starts at the end of the list ;
          ListIterator&lt;Integer&gt; litr = list.listIterator();
          //2.  while hasPrevious ;
          while (litr.hasPrevious()) {
              //3. print what is returned by previous() followed by a blank without a newline  
              System.out.println(litr.previous()+ " ");
          }
          //-----------------End here. Please do not remove this comment.     Reminder: no changes outside the todo regions.
          System.out.println() ;
      }
  }
  </code></pre>