Fill Elements in a boolean Array in Java
Description
The following code shows how to fill Elements in a boolean Array.
Example
//from w w w . ja v a2 s . c o m
import java.util.Arrays;
public class Main {
public static void main(String[] argv) throws Exception {
boolean[] booleanArr = new boolean[10];
boolean booleanFillValue = false;
Arrays.fill(booleanArr, booleanFillValue);
System.out.println(Arrays.toString(booleanArr));
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »