title: Implementing custom compareTo
body: <pre><code>@Override
  public int compareTo(Object t) 
  {
      if(t instanceof Student)
      {
          Student s = (Student)t;
          return (this.name.compareTo(s.name));
      }
      else
          return -1;
  }
  </code></pre>
  
  <p>This is my <code>compareTo</code> method implementation for comparing two <code>Student</code> objects based on their name. Is it possible to compare two such objects based on multiple fields i.e., both name and age?</p>