Java tutorial
import java.util.Arrays; import java.util.Collections; public class Main { public static void main(String[] args) { Integer[] points = new Integer[5]; points[0] = 4; points[1] = 3; points[2] = 0; points[3] = 4; points[4] = 4; Arrays.sort(points); System.out.println(Arrays.toString(points)); Arrays.sort(points, Collections.reverseOrder()); System.out.println(Arrays.toString(points)); } } /*[0, 3, 4, 4, 4] [4, 4, 4, 3, 0] */