Recursively dump the contents of an aggregate structure (Collection, Array) in Java
<p>This is my very first question on Stackoverflow, so please bear with me if you find anything nonsensical in my very first post. FYI that I've gone through the SO FAQ and I'm aware of its various policies. You see, I'm a guy that has heavily worked with languages such as PHP, Perl, Python, ROR and recently I "context-switched" to Java EE. You see, several of the languages that I've worked on had a construct that enabled me to recursively dump the contents of an aggregate structure without a for/foreach/for..in loop</p>

<p>For example,</p>

<pre>a = Any composite Data structure </pre>

<p>PHP has <pre>var_dump() and print_r() </pre></p>

<p>Perl has <pre>Data::Dumper</pre></p>

<p>ROR has <pre>PrettyPrint</pre></p>

<p>and Python has <pre>pprint module</pre> .</p>

<p>So my question goes,</p>

<p>Is there an equivalent of any of these in the Java universe ?  I find it very convenient when I used to work in any of these languages (PHP/Perl/Python/ROR) to dump the contents of an composite data-structure to examine how it looks and then process it further (or decide on how to process it further)</p>

<p>Thanks for your time and apologies if my post overlooks any SO rules.</p>
