• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

I/O stream  RSS feed

 
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!
 
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
Boost this thread!