I'm having trouble seeing the difference between when to use Generics vs Object
. Right now I'm implementing quicksort and have seen examples of it done using
Generics - public static <T extends Comparable<T>> void qsort(T[] arr, int a, int b)
Objects - public static void quicksort(Object[] a, int left, int right)
Comparable - <T extends Comparable<T>> void sort(T[] a)
What really is the difference and when to use each? My goal is to make the class accessible to the largest number of data types.