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 Object array
        Object arr[] = new Object[] { 1.5, 5.6, 4.5, 2.3, 6.7 };

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

        // using fill for placing 12.2
        Arrays.fill(arr, 12.2);

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