How to repeatedly add the same element to an array : <p>How to repeatedly add the same element to an array, I am new beginner in Java, could anyone help me solve this problem</p>

<p>For example, </p>

<pre><code>When N = 1
int[] a1 = {1,2,3}

When N = 2
the result is 
a1 = {1,2,3,1,2,3}
</code></pre>

<p>what's about 2-d array?</p>

<pre><code>N is the number of rows
When N = 1
int[][] a1 = {{1,2,3},{4,5,6},{7,8,9}}

When N= 2
a2 = {{1,2,3},{4,5,6},{7,8,9}
      {1,2,3},{4,5,6},{7,8,9}}
</code></pre>
