Java Array Fill fill(final T[] array, final T value)

Here you can find the source of fill(final T[] array, final T value)

Description

Fill the given array with the given value

License

Open Source License

Parameter

Parameter Description
T Type of array elements
array array to fill
value value to use

Return

filled array

Declaration

public static <T> T[] fill(final T[] array, final T value) 

Method Source Code


//package com.java2s;
import java.util.Arrays;

public class Main {
    /**/*from w  ww .j av a 2s .c  o m*/
     * Fill the given array with the given value
     * @param <T> Type of array elements
     * @param array array to fill
     * @param value value to use
     * @return filled array
     */
    public static <T> T[] fill(final T[] array, final T value) {
        Arrays.fill(array, value);
        return array;
    }
}

Related

  1. fill(double[][] array, double s)
  2. fill(double[][] d, double val)
  3. fill(final double[][] arr, final double val)
  4. fill(final Object[] array, final int start, final int end, final Object value)
  5. fill(final T[] array, final int size)
  6. fill(int[][] array, int value)
  7. fill(String[] ary, String value)
  8. fill(T[][][] arr, T val)
  9. fillArray(byte[] btArray, byte[] btValue, int iStartPosition, int iLength, byte btAlternateValue, int iAlign)