Unable to Pass test cases

mam plz look into my code .please mark me with the error i my code i have made a new class and that class is implementing the comparable interface.

if (s[i].sal > = k) {
System.out.println(s[i].name + " " + s[i].sal);
}

make it >= instead of >

Thank you .Also mam what is the difference in implementing comparable or comparator interface.

  1. Comparable interface can be used to provide single way of sorting whereas Comparator interface is used to provide different ways of sorting.
  2. For using Comparable, Class needs to implement it whereas for using Comparator we don’t need to make any change in the class.
  3. Comparable interface is in java.lang package whereas Comparator interface is present in java.util package.
  4. We don’t need to make any code changes at client side for using Comparable, Arrays.sort() or Collection.sort() methods automatically uses the compareTo() method of the class. For Comparator, client needs to provide the Comparator class to use in compare() method.

go through this article for more info: