<p>last time I asked how to populate a data structure <a href="https://stackoverflow.com/questions/144474/java-arrays-vectors">here</a>. Now I would like to know if there's something in Java, like the <a href="http://www.php.net/print_r" rel="nofollow noreferrer">print_r</a> I use in PHP, to represent what I have populated in the Maps and lists without having to do my own algorithm.</p>

<p>Any ideas?</p>

Calling
```
toString
```
on the collection should return a string containing all the elements string representations.
This won't work with built-in arrays though, as they don't have a
```
toString
```
override and will just give you a memory address.