I have a file "input.txt", which has 4 lines of input.
I want to store all the data from line one to one array; second line to another array and so on for the other two.
Here is the example of the file
1 2 3 4 5 6 7 8 9 10 0
3 5 6
4
5 7
i have tried this
Scanner s = new Scanner(new File("input.txt"));
int[] array = new int[s.nextInt()];
for (int i = 0; i < array.length; i++)
array[i] = s.nextInt();