title: Java 2D Arrays Question
body: <p>If I have a 2D array, <code>arr[][]</code>, and let say I do this: <code>arr[0]=10;</code> What does this do? I only assigned 10 in the first dimension, but I didnt mention the second dimension. What happens in this case?</p>
  
  <p>Edit: Ok what about this:</p>
  
  <pre><code>public static int[][] mystery(int[][] srcA, int[][] srcB) {
  
      2 int width= srcA.length, height = srcA[0].length;
      3 int[][] output = new int[width][height];
      4 for (int x = 0; x &lt; width; x++) {
      5 if(x%2 ==0) output[x] = srcA[x];
      6 else output[x] = srcB[x];
      7 }
      8 return output;
      9 }
  </code></pre>