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








Syntax

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

public static String toString(boolean[] a)

Example

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 };

    System.out.println(Arrays.toString(b1));    
  }
}

The code above generates the following result.