How to copy String array
<p>Hey Guys I have some difficulties which is I want to copy string array value into new string array
for example :</p>

<pre><code>    String[][] array = new String[3][2];
    array[0][0] = "hello";
    array[0][1] = "1";
    array[1][0] = "guys";
    array[1][1] = "2";
    array[2][0] = "good ";
    array[2][1] = "3";

    array = new String [5][2];
    all the value in the first array to be copied
    array[3][0] = "";
    array........;
</code></pre>

<p>maybe you guys can help me how to copy all the value into new string array thanks</p>

<p>I already try this method but it keeps me giving nullpointer issue whenever I want to insert new value :</p>

<pre><code>String[][] array = new String[3][2];
    array[0][0] = "olo";
    array[0][1] = "ada ";
    array[1][0] = "apa";
    array[1][1] = "dengan";
    array[2][0] = "si ";
    array[2][1] = "carlo";


    String[][] newArray = new String[5][2];
    newArray = Arrays.copyOf(array, 5);
    array = new String[5][2];
    array = Arrays.copyOf(newArray, 5);
    array[3][0] = "lo";
    array[3][1] = "gw";
    array[4][0] = "end";
    array[4][1] = "ennnnnd";

    for (int r = 0; r &lt; array.length; r++) {
        for (int c = 0; c &lt; array[r].length; c++) {
            System.out.print(" " + array[r][c]);
        }
        System.out.println("");
    }
</code></pre>

<p>thanks</p>
