Java Collection Tutorial - Java Arrays.toString(boolean[] a)


Arrays.toString(boolean[] a) has the following syntax.

public static String toString(boolean[] a)


In the following code shows how to use Arrays.toString(boolean[] a) method.

/* w  w  w . j  a va  2  s  .  c om*/

import java.util.Arrays;

public class Main {

   public static void main(String[] args) {

    // initializing boolean array
    boolean[] b1 = new boolean[] { true, false };


The code above generates the following result.