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.
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)
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");
Maybe this helps?
output1.println("Text here that needs to the file1");