So i learned on how to, arrange my arrays in ascending order, but now im stuck finding ways on how to get my arrays in descending order.
so far this is my code:
import java.util.Collections;
import java.util.Arrays;
public class arrays {
public static void main(String args[]){
int arrays[]={4,3,8,9,0,44,12};
Arrays.sort(arrays, Collections.reverseOrder());
for(int i=0;i<arrays.length;i++){
System.out.print(arrays[i]);
}
}
}
But my IDE(Eclipse) says that there is an error on "Arrays.sort(arrays, Collections.reverseOrder());" which i cant figure out. help please.