fill Int Array - Java java.lang

Java examples for java.lang:int Array

Description

fill Int Array

Demo Code



public class Main{
    public static void fillIntArray(final int[] array,
            final ArrayFillFunction<Integer> func) {
        for (int i = 0; i < array.length; ++i) {
            array[i] = func.getElementForIndex(i);
        }//w  w w.  j  av a  2s  .c  o  m
    }
}

Related Tutorials