📜  java文本文件到arraylist - Java代码示例

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

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