How can I fill a multidimensional array in Java without using a loop? I\'ve tried:
double[][] arr = new double[20][4]; Arrays.fill(arr, 0);
Arrays.fill works only with one-dimensional array
Source of java.util.Arrays:
public static void fill(Object[] a, Object val) { int i = 0; for(int len = a.length; i < len; ++i) { a[i] = val; }
Use own loops for initialization array