Create an instance of PrintWriter and use its methods to write data to the file. When finished writing to the file, close it.
--- Update ---
Also posted at: create new file, ask user to write...
Type: Posts; User: Norm
Create an instance of PrintWriter and use its methods to write data to the file. When finished writing to the file, close it.
--- Update ---
Also posted at: create new file, ask user to write...
To write in a file you need to use a class and its methods. For example the PrintWriter class class has methods for writing a String and other data types to a file.
Since its a console program, use println() to ask the questions and the methods of the Scanner class to read the user's response. Do a Search on the forum for plenty of examples of usages of Scanner...