This content has been marked as final. Show 2 replies
I was going through some lectures online and found that to compare or even swap, the use of comparable or comparator argument like
public static boolean less(Comparable v,Comparable w)
public static void swap(Comparable a,int i,int j)
I did not get the use of passing Comparable or Comparator to the function as parameters. Object as parameter could have been used too?
Please help me understand this.