Check out example codes for "java read integer from text file into array scanner". It will help you in understanding the concepts better.

Code Example 1

Scanner scanner = new Scanner(new File("input.txt"));
int [] tall = new int [100];
int i = 0;
while(scanner.hasNextInt())
{
     tall[i++] = scanner.nextInt();
}

Learn ReactJs, React Native from akashmittal.com