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.
Read the 'Object Ordering' trail of The Java Tutorials. It covers that exact topic and should answer your question.