writing to a file


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: writing to a file

  1. #1
    Join Date
    Jul 2004
    Posts
    6

    writing to a file

    Hey there,

    I'm new to java and I need to write a string that i generated in my code to an output file. I'm currently writing the string to the standard output like so :

    System.out.println("K_"+Receiver+",t"+msgnum+"(R("
    +Receiver+",t"+msgnum+"("+out1+")))");

    All the types e.g. 'Receiver' or 'out1' are of type string. Could anyone show me how to open a file for writing and then write this information to the file? Is there some sort of file writer equivalent for system.out.println()? Thanks very much

  2. #2
    Join Date
    Mar 2004
    Posts
    635
    Lookup the class, FileWriter.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center