Table of Content

Fill a Boolean Array in Java

Declaration :

Explanation :

Purpose The java.util.Arrays.fill(boolean[] a boolean val) method assigns the specified boolean value to each element of the specified array of booleans.
Parameters a ===> This is the array to be filled.
val ===> This is the value to be stored in all elements of the array.
Return Value This method does not return any value.
Exception NA

Java Program : Example

Below example will explain java.util.Arrays.fill() method.

Output of Program :