Given that Arrays.sort(Object[]) throws a runtime exception if any element of the array cannot be cast to Comparable, wouldn't it be better to make the method signature Arrays.sort(Comparable[]), and turn those runtime exceptions into compilation errors?
Asked
Active
Viewed 44 times