Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsReverseOrderExample2 { public static void main(String[] args) { //Create Array list object List
list = Arrays.asList("Java", "Python", "Ruby", "COBOL"); Collections.sort(list, Collections.reverseOrder()); System.out.println("List sorted in ReverseOrder: "); System.out.println(list); } }
Output