Could someone please kindly tell me why the code below wouldn't work unless the array is Integer[], not int[]
Integer[] one = {2,5,8,1,3,4,9};
Arrays.parallelSort(one, (p1, p2) -> p2 - p1);
System.out.println(Arrays.toString(one));
Because Arrays has no method parallelSort that takes an int[] and a Comparator.
The only parallelSort overload that takes a Comparator second argument is the one with a generic first argument (static <T> void parallelSort(T[] a, Comparator<? super T> cmp)), thus requiring that the first argument be an array of references. Integer[] satisfies that requirement, while int[] does not.