title: Adding blank rows to a 2d array in Java
body: <p>Say I have the following 2d array in Java set to a variable named myMap:</p>
  
  <pre><code>1 3 1
  3 2 3
  1 3 1
  </code></pre>
  
  <p>The next step in my program is to add rows and columns of zeros as follows:</p>
  
  <pre><code>1 0 3 0 1
  0 0 0 0 0
  3 0 2 0 3
  0 0 0 0 0
  1 0 3 0 1
  </code></pre>
  
  <p>Basically, I'm adding arrays of zero into the spaces between the previous rows/columns. I then fill them in with appropriate numbers (irrelevant to my question) and repeat the process (adding more rows/columns of zeros) a finite number of times.</p>
  
  <p>My question is as follows- what is the easiest and most efficient way to do this in Java? I know I could create a new 2d array and copy everything over, but I feel like there may be a more efficient way to do this. My intuition says that a 2d ArrayList may be the better way to go.</p>
  
  <p>Also, and this my be important, when my program begins, I DO know what the maximum size this 2d array. Also, I cannot expect the symmetry of the numbers that I put in for this example (these were just put in for a good visual reference).</p>