How to display a 2D table in java
<p>I try do disply a 2 D table but for some reason I can't, I don't see what i wrote wrong.</p>

<p>This is my code (I am working in vim):</p>

<pre><code>            int [][] tab = new int [5][5];

            for (int i= 0; i&lt;tab.length ; i++){
                    for (int j =0; j&lt;tab[i].length; j++){
                            tab[j][i]=i;
                            System.out.println("" + tab[j][i]);
                    }
                    System.out.println("");
            }
    }
</code></pre>

<p>The result of this code is:</p>

<p>0</p>

<p>0</p>

<p>0</p>

<p>0</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>2</p>

<p>2</p>

<p>2</p>

<p>2</p>

<p>3</p>

<p>3</p>

<p>3</p>

<p>3</p>

<p>4</p>

<p>4</p>

<p>4</p>

<p>4</p>

<p>And i want:</p>

<p>0
0
0
0</p>

<p>1
1
1
1</p>

<p>2
2
2
2</p>

<p>3
3
3
3</p>

<p>4
4
4
4</p>

<p>Can someone help me with this?</p>

<p>Thank you</p>
