title: LinkedList to a String
body: <p>How would I convert a LinkedList such as: </p>
  
  <pre><code>5=&gt;2=&gt;2=&gt;1
  </code></pre>
  
  <p>to a String such as </p>
  
  <pre><code>"1225"
  </code></pre>
  
  <p>I am kind of new to java, but my guess is to pop the list and use a StringBuilder. I am just not sure how to use a StringBuilder correctly.</p>
  
  <pre><code>public String toString()
  {
      StringBuilder sb = new StringBuilder();
      for(int i=0; i &lt;getNumberOfDigits(); i++)
      {
          sb.append(list.pop());
      }
  
      String toReturn = sb.toString();
      return toReturn;
  }
  </code></pre>
  
  <p>EDIT:
  I am not trying to sort the list, I just wanted to print it out in reverse order.</p>