How to sort objects in java?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2535124/how-to-sort-an-arraylist-of-objects-by-a-property">How to sort an arraylist of objects by a property?</a><br>
  <a href="http://stackoverflow.com/questions/12228659/what-is-the-sorting-algorithm-for-java">What is the sorting algorithm for Java</a>  </p>
</blockquote>



<p>I have a class in java that keeps record of <code>diffSeconds</code>.</p>

<pre><code>class fileObj
    {
        public String fileName; 
        public Date modificationTime; 
        public long diffSeconds;     

        fileObj()
        {
            modificationTime = null; 
        }
    }
</code></pre>

<p>I have a forloop that makes multiple instances of the <code>fileObj</code> class and adds them to a list. </p>

<pre><code>List&lt;fileObj&gt; fileView = new ArrayList&lt;fileObj&gt;();
for(int j=0; j&lt;10; j++)
       {
         fileView.add(new fileObj());
       }
</code></pre>

<p>Assuming that each class has a <code>diffSeconds</code> values assigned to them, how can i order the list depending on the value (largest first)</p>
