Hey
i have to write a program that will prompt the user to write sentences and those sentences will be written until the user type "stop".
i though of doing such a thing but its not doing what i want because i want each input to be on a new line.
import java.io.*;
public class Writing{
public static void main(String [] args)
{
try{
File file = new File("mytext.txt");
PrintWriter out =
new PrintWriter(
new BufferedWriter(
new FileWriter(file, true)));
}
catch (IOException e)
{
System.err.println ("Unable to write to file");
System.exit(-1);
}
}
}
and also another thing i dont know how to finish writing to the text file.
Thanks in advance