Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reading in file content

 
Tony Cossie
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Could anyone tell me how i could read in an entire list of words into one entire string?
Or how do i read in a list of words into a hash set? Because i think that might be quicker?
I'd be grateful if you could give me a code snippet too please.
Thanks.
 
Tony Cossie
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry for multiple posts, but
what's the fastest possible way i could read in a large list of words from 2 files,[ do a search - have that myself] and print out the results?
 
Iain Lowe
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The quickest (and probably simplest) thing is to use the java.util.Properties class which is a descendant of Map. This means you can create a file of name-value pairs and read the whole file into memory with a call to Properties.load().
Hope this helps
[This message has been edited by Iain Lowe (edited October 17, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic