Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to write the String Array into the new file

 
niras iva
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sir:
i create a own file My coding is here,

i want to write the value of s in my file.

i want to take the value of s and write into my new file..how can i do this?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15437
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to write it as text, then don't use DataOutputStream. Streams (InputStream and OutputStream) are for reading and writing binary data, not text. If you want to write text, use a Writer instead of an OutputStream. For example:

 
niras iva
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you sir
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic