title: Sorting A Array of Object based on one variable
body: <p>Hello everyone I have a class named GEN and I have an array of this what I want to to is sort this array based on time variable
  So theone with the shortest time must be the gend[0].
  I hope I explained my question clear and I am using NetBeans</p>
  
  <pre><code> public class GEN
  {
      int[][] mark=new int[TIMELIMIT][N+1];
      int[][] dimark=new int[TIMELIMIT][N+1];
      int time=0;
      int[] touched=new int[N+1];
  }
  public GEN[] gend=new GEN[GENNUM];
  </code></pre>