So im not sure if there are other questions like this, but from what i have sen none of them seem to help me.
so I have a string that say has the words "hello","good day", and "good bye" and i have it declared like this
String content="hello\n good day\n good bye";
Now I would like to make a txt file in the project sub directory under a folder called "output", so its directory is user/project1/output
the thing is I would like this txt file to print each word on a separate line, I have the following code so far that does make a txt file with content string, but everything is on the same line
File file = new File("output1.txt");
FileOutputStream outputStream = new FileOutputStream(file, false);
PrintWriter out = new PrintWriter(outputStream, true);
out.println(content);
and the output looks like this
hello good day food bye
how can I have it so the txt file looks like this
hello
good day
good bye