2

I am sorting my int array in a descending order and I am getting this error. What is it about?

Error "reason: no instance(s) of type variable(s) T exist so that int[] conforms to T[]"

Arrays.sort(myArray, Collections.reverseOrder());

abbas
  • 235
  • 1
  • 3
  • 14
  • 2
    use `Integer[]` instead of `int[]`. Because `Collections.reverseOrder()` expects a generic type which cannot be a primitive `int`. – name not found Apr 15 '20 at 08:53

0 Answers0