fill Double Array - Java Collection Framework

Java examples for Collection Framework:Array Fill

Description

fill Double Array

Demo Code



public class Main{
    public static void fillDoubleArray(final double[] array,
            final ArrayFillFunction<Double> func) {
        for (int i = 0; i < array.length; ++i) {
            array[i] = func.getElementForIndex(i);
        }/*from ww  w  .  j  a v a2  s.  c  o m*/
    }
}

Related Tutorials