Java Arrays.toString(char[] a)

Syntax

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

public static String toString(char[] a)

Example

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


//from www  . j a  v a  2s.  c  om

import java.util.Arrays;

public class Main {

   public static void main(String[] args) {

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

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

The code above generates the following result.