Table of Content

Convert an Object Array to String in Java

Declaration :

Explanation :

Purpose The java.util.Arrays.toString(Object[] a) method returns a string representation of the contents of the specified Object array. If the array contains other arrays as elements they are converted to strings by the Object.toString() method inherited from Object which describes their identities rather than their contents.
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 :