title: How to sort ArrayList values by name in java
body: <p>I am getting student information from database,</p>
  
  <pre><code>ArrayList&lt;Student&gt; studentList = session.createQuery("from Student order by Date").list();
  </code></pre>
  
  <p>the studentList contains name , id ,marks, by date. I want to display this arraylist by name, becase the same student name contains different date.
  How to sort this from arraylist.
  Ex studentList value is</p>
  
  <pre><code>1 x  2010-10-01
  2 y  2010-10-05
  3 z  2010-10-15
  1 x  2010-10-10
  1 x  2010-10-17
  2 y  2010-10-15
  4 xx 2010-10-10
  </code></pre>
  
  <p>I want to display this to</p>
  
  <pre><code>1 x  2010-10-01
  1 x  2010-10-10
  1 x  2010-10-17
  2 y  2010-10-05
  2 y  2010-10-15
  3 z  2010-10-15
  4 xx 2010-10-10
  </code></pre>
  
  <p>and store this to another array list</p>