title: Java error :- "no suitable method found for sort(Student[],j)"
body: <p>Hello guys I am new to java programming and while practising I encountered an error please help me solve this problem which I have stated above (title). I am also attaching my code here please fix this issue and thanks in advance :)</p>
  
  <p>Code:</p>
  
  <pre><code>import java.util.Collections;
  import java.util.Comparator;
  class Student{
      public int marks;
      public String name;
      public Student(int marks, String name){
          this.marks = marks;
          this.name = name;
      }
      @Override
      public String toString(){
          return ("Name: " + this.name + " Marks: " + this.marks);
      }
  }
  public class j implements Comparator&lt;Student&gt;{
      @Override
      public int compare(Student o1, Student o2){
          if (o1.marks &lt; o2.marks)
              return 1;
          else
              return -1;
      }
      public static void main(String[] args) {
          Student[] array = new Student[2];
          array[0] = new Student(10, "varun");
          array[1] = new Student(20, "gupta");
          Collections.sort(array, new j());
          for (Student i : array)
              System.out.println(i);
      }
  }
  </code></pre>