Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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);
    }
}