traversing a 2-dimensional array in java
<p>i watch in a tutorial that i can traverse an array of object in this way:</p>

<pre><code>     Animals[] an = new Animals[2];

         for (Animals a:an){
                 .
                 .
         }
</code></pre>

<p>But now i want to traverse a 2 dimensional array and when i use this code i have a problem(says:incompatible types
              required:appl1.Animals
              foundLappl1.Animals[]). when i use this code</p>

<pre><code>   Animals[][] an = new Animals[2][2];

      for (Animals a:an){
             .
             .
       }
</code></pre>

<p>Does anyone knows how can i overcome this problems. Thank you in advance for your help.</p>
