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 double array
        double dArr[] = { 13.1, 1.4, 0.7, 1.5, 0.7 };

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

        // sorting array from index 0 to 3
        Arrays.sort(dArr, 0, 3);

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