📜  java 将文本文件导入arraylist - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:18.594000             🧑  作者: Mango

代码示例2
Scanner s = new Scanner(new File("filepath"));
ArrayList list = new ArrayList();
while (s.hasNext()){
    list.add(s.next());
}
s.close();