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.2, 1.2, 0.7, 6.2, 4.5 };

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

        // sorting array
        Arrays.sort(dArr);

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