• Post Reply Bookmark Topic Watch Topic
  • New Topic

which type of writer to use  RSS feed

 
gowri desai
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all!,
This is the first time i have been assigned to do java at work ( though I went through formal training for 3 weeks). I have to write the text from string into the file in a particular directory. which type of writer should i choose, PrintWriter, FileWriter . the string consists of alphanumeric text.
can someone explain what would be the best option and why?
Thanks a ton!
gowri.
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a table comparing all the IO streams and writers in the Java Tutorial: Using IO Trail. Since you are new to Java, it would be wise to spend some time with the Java Tutorial, since it touches on most every facet of the Java API.
 
srinivas daroori
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most of the times, Buffered writer would be useful in the aspect of performance also.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!