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 float array
        float fArr[] = { 13.2f, 1.2f, 0.7f, 1.2f, 4.5f };

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

        // sorting array
        Arrays.sort(fArr);

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