Results 1 to 3 of 3
Thread: Writing output file
- 11-04-2010, 03:47 AM #1Member
- Join Date
- Oct 2010
- Rep Power
Writing output file
I made a OneTimePad program and want to output the encrypted message to a text file from a string. I want to keep a running log of the output so it stores the string again after each iteration of the program.
Just looking for a little push in the right direction as to what I should be doing.
Last edited by doymand; 11-04-2010 at 04:21 AM.
- 11-04-2010, 04:40 PM #2
You basically just want to write a string to a text file?
Have a look at the Java I/O API. It talks about files, paths, input/output, and so on. It's a great place to start, at the very least.
Lesson: Basic I/O (The Java™ Tutorials > Essential Classes)
- 11-05-2010, 01:24 PM #3
I use printWriter to write something to a .txt file.
First I make a file, and later I let the program write things into the file
File output = new File("File1.txt"); PrintWriter output1 = new PrintWriter("File1.txt");Java Code:
output1.println("Text here that needs to the file1"); output1.flush();
- By renu in forum New To JavaReplies: 0Last Post: 09-30-2010, 08:16 PM
- By bikashg in forum New To JavaReplies: 5Last Post: 05-29-2010, 11:38 PM
- By Broden_McDonald in forum New To JavaReplies: 1Last Post: 02-27-2010, 01:29 AM
- By aks.nitw in forum Advanced JavaReplies: 5Last Post: 01-18-2010, 01:33 PM
- By JThangiah in forum XMLReplies: 2Last Post: 03-27-2008, 04:15 PM