title: Changing the column size of 2D array at runtime
body: <p>In the code below,I have defined a (2x2) 2D array, <code>arr</code>. And then I declare a one dimensional String array <code>a</code> with 5 elements, and assign it to the first row of the 2D array. Why am I allowed to do this, and why does not it throw array index out of bound exception? </p>
  
  <p>I think it may be due to the reference assignment but still I am confuse about how one is allowed to change the array dimension at runtime.</p>
  
  <pre><code>String a[] = { "1", "2", "3", "4", "5" };
  
  String[][] arr= new String[2][2];
  
  int x;
  
  arr[0] = a;
  x = arr[0].length;
  System.out.print("The row length is "+ x);
  </code></pre>
  
  <p>Output:The row length is 5.</p>