1// The default value of booleans in a boolean array is false
2
3boolean[] boolArray = new boolean[5];
1import java.util.Arrays;
2public class BooleanArrayTest {
3 public static void main(String[] args) {
4 Boolean[] boolArray = new Boolean[5]; // initialize a boolean array
5 for(int i = 0; i < boolArray.length; i++) {
6 System.out.println(boolArray[i]);
7 }
8 Arrays.fill(boolArray, Boolean.FALSE);
9 // all the values will be false
10 for(int i = 0; i < boolArray.length; i++) {
11 System.out.println(boolArray[i]);
12 }
13 Arrays.fill(boolArray, Boolean.TRUE);
14 // all the values will be true
15 for (int i = 0; i < boolArray.length; i++) {
16 System.out.println(boolArray[i]);
17 }
18 }
19}