Java tutorial
import java.util.Arrays; import java.util.stream.Stream; public class Main { public static void main(String[] args) { Integer[] numbers = new Integer[] { 2, 7, 3, 9, 5, 4, 6, 8, 1 }; Arrays.sort(numbers, Integer::compareTo); Stream.of(numbers).forEach(System.out::println); } }