Check out example codes for "java text file to arraylist". It will help you in understanding the concepts better.

Code Example 1

List<String> list = Files.readAllLines(new File("input.txt").toPath(), Charset.defaultCharset() );

Code Example 2

Scanner s = new Scanner(new File("filepath"));
ArrayList<String> list = new ArrayList<String>();
while (s.hasNext()){
    list.add(s.next());
}
s.close();

Learn ReactJs, React Native from akashmittal.com