Java Array Fill fill(final double[][] arr, final double val)

Here you can find the source of fill(final double[][] arr, final double val)

Description

Fills the given two-dimensional double array with the value val .

License

Open Source License

Parameter

Parameter Description
arr array to fill
val value to fill the array with

Return

filled array

Declaration

public static double[][] fill(final double[][] arr, final double val) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Arrays;

public class Main {
    /**//  w w w . j  a va  2s. com
     * Fills the given two-dimensional {@code double} array with the value
     * {@code val}.
     *
     * @param arr array to fill
     * @param val value to fill the array with
     * @return filled array
     */
    public static double[][] fill(final double[][] arr, final double val) {
        for (final double[] line : arr) {
            Arrays.fill(line, val);
        }
        return arr;
    }
}

Related

  1. fill(byte[] arr)
  2. fill(byte[] val, byte b)
  3. fill(char[] chars, int fromIndex, int toIndex, char c)
  4. fill(double[][] array, double s)
  5. fill(double[][] d, double val)
  6. fill(final Object[] array, final int start, final int end, final Object value)
  7. fill(final T[] array, final int size)
  8. fill(final T[] array, final T value)
  9. fill(int[][] array, int value)