Fill Elements in a double type Array in Java
Description
The following code shows how to fill Elements in a double type Array.
Example
/*ww w . j av a2s . c o m*/
import java.util.Arrays;
public class Main {
public static void main(String[] argv) throws Exception {
double[] doubleArr = new double[10];
double doubleFillValue = -1;
Arrays.fill(doubleArr, doubleFillValue);
System.out.println(Arrays.toString(doubleArr));
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »