Fill Elements in a float type Array in Java
Description
The following code shows how to fill Elements in a float type Array.
Example
//from ww w. j a v a 2s . c om
import java.util.Arrays;
public class Main {
public static void main(String[] argv) throws Exception {
float[] floatArr = new float[10];
float floatFillValue = -1;
Arrays.fill(floatArr, floatFillValue);
System.out.println(Arrays.toString(floatArr));
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »