Java 2D array copy
<p>I have a 2D array and I just need to copy the first row into another array of the same size. What is the best way of doing this? I tried this:</p>

<pre><code>public static int[][] buildCME(int[][] array){

    int [][] arrayCME = new int[array.length][array[0].length];


    for(int y = 1; y &lt; array.length; y++)
    {

        for (int x = 0; x &lt; 1; x++)
        {

            arrayCME[y][x] = array[y][x];

        }
    } 
</code></pre>

<p>However that is just giving me 0's for the first row, which I assume has to do with my int initialization. I created this for loop because I thought it would be easier to account for than to create an if statement in a normal for loop to account for the whole 2D array. Thanks for the help!  </p>
