Table of Content

Convert a Character Array to String in Java


Declaration :

Explanation :

Purpose The java.util.Arrays.toString(char[]) method returns a string representation of the contents of the specified char array. The string representation consists of a list of the array’s elements enclosed in square brackets (“[]”). Adjacent elements are separated by the characters ” ” (a comma followed by a space).
Parameters a ===> This is the array whose string representation to return.
Return Value This method returns a string representation of a.
Exception NA

Java Program : Example

Below example will explain java.util.Arrays.toString() method.

Output of Program :