The Arrays class has a set of helper toString methods for converting an array to a string representation.
String representation = Arrays.toString(array);
This will work for all array types. For Objects it uses the toString() method of the type to convert array elements.
If you needmore control how the array is represented then you will need to implement the conversion yourself using a loop.
No comments:
Post a Comment