📅  最后修改于: 2022-03-11 14:52:48.301000             🧑  作者: Mango
File file = new File(fileName);
Scanner input = new Scanner(file);
List list = new ArrayList();
while (input.hasNextLine()) {
list.add(input.nextLine());
}
//adds each line of a text file into an ArrayList