Java array problem. Cant pass values
<p>Wen I have this code:</p>

<pre><code>    import java.util.Scanner;
    import java.util.Arrays;
    public class Ex02 {

        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            int [] matrixSize = new int [4];
            System.out.println("Insert the values matrix (matrixA_lines,MatrixA_Rows,matrixB_lines,MatrixB_Rows");
            matrixSize = matrixFill(4);
            System.out.println(Arrays.toString(matrixSize));
        }

        public static int[] matrixFill(int sizeOne){
            int i;
            Scanner sc = new Scanner(System.in);

            int [] matrixTemp = new int [sizeOne];
            for (i = 0; i&lt;sizeOne; i++){
                matrixTemp[i] = sc.nextInt();
            }

            return matrixTemp;
        }
    }
</code></pre>

<p>It all works as expected. An unidimensional array is created, filled with 1,2,3,4 and them the array is print. The problem is that i want to use an bidimentsional array. I've modified the code and it gives error.
Here is the modified code:</p>

<pre><code>import java.util.Scanner;
import java.util.Arrays;
public class Ex02 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        int [][] matrixSize = new int [1][4];
        System.out.println("Insert the values matrix (matrixA_lines,MatrixA_Rows,matrixB_lines,MatrixB_Rows");
        matrixSize[][] = matrixFill(1,4);
        System.out.println(Arrays.deepToString(matrixSize));
    }

    public static int[][] matrixFill(int sizeOne, int sizeTwo){
        int i;
        Scanner sc = new Scanner(System.in);

        int [][] matrixTemp = new int [sizeOne][sizeTwo];
        for (i = 0; i&lt;sizeOne; i++){
            matrixTemp[0][i] = sc.nextInt();
        }

        return matrixTemp[sizeOne][sizeTwo];
    }
}
</code></pre>

<p>On line 21 (matrixSize[][] = matrixFill(1,4);) the error is:</p>

<pre><code>cannot find symbol
symbol:   class matrixSize
location: class Ex02.Ex02

not a statement

';' expected
</code></pre>

<p>And on line 34(return matrixTemp[sizeOne][sizeTwo];) the error is:</p>

<pre><code>incompatible types
required: int[][]
found:    int
</code></pre>

<p>Can someone tell me what I'm doing wrong? Just started to learn Java.</p>

<p>Regards,</p>

<p>favolas</p>
