User input numbers into a 2 dimensional array in java
<p>I'm having trouble with user input in java, hope anyone can help :)
The user declares how big the 2d array will be(number d is the side of the square array), then inputs a number "n", which tells the program how many inputs of numbers there will be, and then needs to input these numbers (eg. if n=4, the input must be sth like : 5 17 3 20. 
I have already written the same thing for a single row array</p>

<pre><code>for(i=0;i&lt;=n;i++) {
    arr[i]=sc.nextInt();
}
</code></pre>

<p>but am having trouble doing basically the same for the 2d array.
Any ideas?</p>