Java Arrays toString Char


Java Arrays toString Char

package com.codingdict;

import java.util.Arrays;

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

      // initializing char array
      char[] c1 = new char[] { 'd', 'e', 'f' };

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

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