Here you can find the source of fill( T[] a, T val)
val
to each element of the array a
.
Parameter | Description |
---|---|
a | the array to be filled. |
val | the value to be stored in all elements of the array. |
public static <T> T[] fill( T[] a, T val)
//package com.java2s; import java.util.Arrays; public class Main { /**// w w w . j a va2 s . c o m * Assigns the specified T reference <code>val</code> to each element of the * array <code>a</code>. * * @param a the array to be filled. * @param val the value to be stored in all elements of the array. * @return a */ public static <T> T[] fill(/*INOUT*/ T[] a, T val) { Arrays.fill(a, val); return a; } }