How do I loop through an array in Java?
<p>Related to my question about <a href="http://stackoverflow.com/questions/1221824/building-a-tree-like-structure">how to build a tree-like structure</a>, the data I receive from the server are in arrays like this: <code>{School  Chair   Table   Chalk}</code></p>

<p>How can I loop through this so that:</p>

<ul>
<li><code>School</code> becomes parent of <code>Chair</code></li>
<li><code>Chair</code> becomes parent of <code>Table</code></li>
<li><code>Table</code> becomes parent of <code>Chalk</code></li>
</ul>
