Run ❯
Get your
own Java
server
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
import java.util.ArrayList; import java.util.Collections; public class Main { public static void main(String[] args) { ArrayList
cars = new ArrayList
(); cars.add("Volvo"); cars.add("BMW"); cars.add("Ford"); cars.add("Mazda"); Collections.sort(cars, Collections.reverseOrder()); // Sort myNumbers for (String i : cars) { System.out.println(i); } } }
Volvo
Mazda
Ford
BMW