Array of Hope: Displaying Arrays in Java 1.5

For quite some time, Java programmers have been writing their own utility methods to print the contents of an array. This is because the JDK didn't provide a convenient way to convert an array into a String value. To make matters worse, an array of Strings has always returned the following information from its toString method:

[Ljava.lang.String;@360be0

This information has not been very useful to any Java developer that I know of! The [ character means that it's an array, Ljava.lang.String; is the internal name for the String class (the element type of the array), and @360be0 is the hashcode. ...

Get Wicked Cool Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.