Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Arrays;
import java.util.Collections;

public class Main {
    public static void main(String[] args) {
        Integer[] arrayToSort = new Integer[] { new Integer(5), new Integer(89), new Integer(16), new Integer(2) };

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

        for (Integer i : arrayToSort) {
            System.out.println(i.intValue());
        }
    }
}
/*89
16
5
2
*/