Text file into Java List using Commons or Guava

前端 未结 7 542
灰色年华
灰色年华 2021-01-08 01:18

What is the most elegant way to put each line of text (from the text file) into LinkedList (as String object) or some other collection, using Commons or Guava libraries.

相关标签:
7条回答
  • 2021-01-08 02:12

    using org.apache.commons.io.FileUtils

    FileUtils.readLines(new File("file.txt"));
    
    0 讨论(0)
提交回复
热议问题