Table of Content

Fill a Double Array in Java

Declaration :

Explanation :

Purpose The java.util.Arrays.fill(double[] a double val) method assigns the specified double value to each element of the specified array of doubles.
Parameters a ===> This is the array to be filled.
val ===> This is the value to be stored in all elements of the array.
Return Value This method does not return any value.
Exception NA

Java Program : Example

Below example will explain java.util.Arrays.fill() method.

Output of Program :