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 short array
        short[] sArr = { 13, 13, 11, 9, 21 };

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

        // sorting array from index 1 to 4
        Arrays.sort(sArr, 1, 4);

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