You can read the data using Scanner, one line at a time, and store the numbers in a List, e.g. an ArrayList:
import java.util.*;
import java.io.*;
public class Numbers
{
public static void main(String[] args) throws FileNotFoundException
{
Scanner data = new Scanner(new File("A.txt"));
List<List<Integer>> ints = new ArrayList<List<Integer>>();
while (data.hasNextLine()) {
List<Integer> lineInts = new ArrayList<Integer>();
Scanner lineData = new Scanner(data.nextLine());
while (lineData.hasNextInt()) {
lineInts.add(lineData.nextInt());
}
ints.add(lineInts);
}
System.out.println(ints);
}
}
This code opens the file for reading, and creates a two-dimensional ArrayList. The outer list contains a list for each line in the file. The inner lists contain the integers on the respective lines. Note that empty lines result in empty lists. Also, you will have to properly handle any IO exception, unlike the code shown above.
If you really want the integers in a two dimensional array instead of an ArrayList, then you'll either have to call toArray, or alter the code above. That is left as an exercise for the reader.