2D array in java and using it as 1D
<p>I was going through some basic MCQ questions in Java and I was unable to understand this one.</p>

<pre><code> public class CommandArgsThree {
     public static void main(String[] args) {
         String[][] argCopy = new String[2][2];
         int x;
         argCopy[0] = args;
         x = argCopy[0].length;
         for (int y = 0; y &lt; x; y++) {
             System.out.print(" " + argCopy[0][y]);
         }
     }
 }
</code></pre>

<p>and the command-line invocation is</p>

<blockquote>
  <p>java CommandArgsThree 1 2 3</p>
</blockquote>

<p>Now what I can't understand is that the <code>argCopy</code> has been declared as a 2D array then how can it be used as 1D couple of lines later where <code>argCopy[0]</code> has been assigned the value of args?</p>

<p>P.S: I also know that argCopy[0] is 1D array that's why I am asking how can we use the 2D array as 1D here?Means is it legal to do so?</p>