본문 바로가기
Language/Java

The method sort(int[]) in the type Arrays is not applicable for the arguments (int[], Collections.reverseOrder())

by brother_stone 2023. 11. 28.

Arrays.sort()로 내림차순을 할 때는 첫번째 매개변수가 T[] a로 객체타입이다. 

따라서 int[]등 primitive타입의 배열을 인자로 넣으면 제목과 같은 오류가 발생하게 된다. 참고하자.