This is my code:
public void p10(int a, int b, int c){
int[] nums = new int[] {a, b, c};
Arrays.sort(nums, Collections.reverseOrder());
System.out.println(Arrays.toString(nums));
}
What could be the problem that it doesn't work and it gives an error? Error states that:
java: no suitable method found for sort(int[],java.util.Comparator<java.lang.Object>) method java.util.Arrays.sort(T[],java.util.Comparator<? super T>) is not applicable (inference variable T has incompatible bounds equality constraints: int upper bounds: java.lang.Object) method java.util.Arrays.sort(T[],int,int,java.util.Comparator<? super T>) is not applicable (cannot infer type-variable(s) T (actual and formal argument lists differ in length))