title: Matrix Manipulation Java
body: <p>let's assume that I have the next two dimensional int array:</p>
  
  <pre><code>  int [][] mat = {{1 1 1 1 1}, 
                    {0 0 0 0 0}, 
                    {3 3 3 3 3}, 
                    {0 0 0 0 0}, 
                    {2 2 2 2 2}};
  </code></pre>
  
  <p>the reason i'm here is because I'm trying to think of a way to shuffle the rows in the next order (without losing the first row data): </p>
  
  <pre><code>   first row data -&gt; second row 
     second row data -&gt; third row
     third row data -&gt; fourth row
     fourth row data -&gt; fifth row
  </code></pre>
  
  <p>a more detailed graphic explanation of what i've written:</p>
  
  <pre><code>    original: 1 1 1 1 1      what i need: 1 1 1 1 1 
                0 0 0 0 0                   1 1 1 1 1 &lt;- first row data on the second row
                3 3 3 3 3                   0 0 0 0 0 &lt;- second row data on the third row
                0 0 0 0 0                   3 3 3 3 3 &lt;- third row data on the fourth row
                2 2 2 2 2                   0 0 0 0 0 &lt;- fourth row data on the fifth row
  
       meaning that the 1st row always remains constant 
       and that the original fifth row always loses its content
  </code></pre>
  
  <p>Any suggestion/tips of how I would implement such thing would be highly appreciated!</p>