• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I/O stream

 
Preet Dhillon
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In the code above - I am trying to replace the Arrays.asList parameters to a text file





What method of file I/O stream should I be using for this purpose. Aslo, can it return a List<String> stooges from this method?

Thank you!
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no single method that you can can use to read a bunch of values from a file and turn them into a List<String>. You will have to go through the process of reading the lines, parsing the values and putting the values into the List. See the IO tutorial for help. Depending on the actual format of the file, parsing may not be as simple as it appears, so using a library which knows how to parse the format might help. For some example libraries that could be useful see our AccessingFileFormats (<= link) FAQ.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic