Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Arrays;

public class Main {

    public static void main(String[] args) {

        // initializing unsorted int array
        int iArr[] = { 12, 1, 119, 16, 4 };

        System.out.println(Arrays.toString(iArr));

        // sorting array
        Arrays.sort(iArr);

        System.out.println(Arrays.toString(iArr));
    }
}