Horizontally combine two 2D arrays in java
<p>I am trying to combine two 2D arrays a, b horizontally such that if:</p>

<pre><code>a = [[1, 1],
     [1, 1]]
b = [[2, 2],
     [2, 2]]
</code></pre>

<p>then the merged array c should look like:</p>

<pre><code>c = [[1, 1, 2, 2],
     [1, 1, 2, 2]]
</code></pre>

<p>It is very simple to vertically combine then to look like this:</p>

<pre><code>d = [[1, 1],
     [1, 1],
     [2, 2],
     [2, 2]]
</code></pre>

<p>but I want to horizontally combine them. Any idea on how to accomplish this for two 2D arrays that have the same dimension?</p>