Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

2 simple questions.  RSS feed

 
Asaf Karass
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All!
simple questions-
1. how can I decide the type of file that I want to write?
I mean creating a file and filling it with data?
what is the best class for this - FileOutputStream ?
2.how do I write in lines?
I mean so there will be lines between the strings I write to the file?
thank you ,
Asaf.
 
lee dalais
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Asaf
to write to a file
(Question 1) FileOutputStream fos = new FileOutputStream("file.dat");
(Question 2) have a look at the BufferedWriter API, look at the newLine() method.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!