In the code below, I believe it would look more appropriate to make the method argument be of type Comparable[] instead of Object[]. The first reason it would be more appropriate is that one can be safe from runtime exceptions because every passed object has to implement interface Comparable. Second, every object in Java inherits from class Object so one can typecast any object as (Object) to use the methods of class Object.package java.util; public class Arrays {.........public static void sort(Object[] a) {        Object[] aux = (Object[])a.clone();        mergeSort(aux, a, 0, a.length, 0);    }.........}Is there a reason why type Object[] is preferred over type Comparable[] as an argument type?
Why use arg type `class Object` instead of `Comparable[]`?
java;object oriented;interfaces