Java Arrays toString 布尔值


Java Arrays toString 布尔值

package com.codingdict;

import java.util.Arrays;

public class ArrayDemo {
   public static void main(String[] args) {

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

      // let us print all the values available in list
      System.out.println("The array is:");
      for (boolean value : b1) {
         System.out.println("Value = " + value);
      }

      System.out.println("The string representation of array is:");
      System.out.println(Arrays.toString(b1));    
   }
}