Java Utililty Methods Array Fill

List of utility methods to do Array Fill

Description

The list of methods to do Array Fill are organized into topic(s).

Method

double[]fillArray(int arrayLength)
Fills An array with zeros
return fillArray(arrayLength, 0);
int[]fillArray(int min, int max)
Create a filled array with values going from min to max-1 (i.e.
int nb = max - min;
int[] ret = new int[nb];
for (int i = 0; i < nb; i++) {
    ret[i] = min + i;
return ret;
Float[]fillArray(int size, Float value)
fill Array
Float[] array = new Float[size];
for (int i = 0; i < size; i++) {
    array[i] = value;
return array;
int[]fillArray(int value, int length)
fill Array
int[] result = new int[length];
Arrays.fill(result, value);
return result;
voidfillArray(int[] array, int value)
fill Array
array[0] = value;
System.arraycopy(array, 0, array, 1, array.length - 1);
voidfillArray(int[] nums)
fill Array
int start = nums.length;
for (int i = 0; i < nums.length; i++) {
    nums[i] = start--;
voidfillArray(Object array, int value)
Assigns the specified int value to each element of the specified any dimensional array of ints.
if (array instanceof int[]) {
    Arrays.fill((int[]) array, value);
} else {
    for (Object agr : (Object[]) array) {
        fillArray(agr, value);
voidfillArray(Object[] array, Object value)
Fills the array with a value.
int to = array.length;
while (--to >= 0) {
    array[to] = value;
Object[]fillArray(Object[] objects, Object object)
Fills array of objects with object
Arrays.fill(objects, object);
return objects;
String[]fillArray(String value, int length)
fill Array
String[] result = new String[length];
Arrays.fill(result, value);
return result;