I am new to Java and I am stuck at this part :
I am trying to output the console output into a text file using JAVA . But the problem is I have a While loop running and my code writes the output to the file but deletes the previous one . I want to append the while loop output to file .
Any help is appreciated . Thanks In advance :)
PrintStream out = new PrintStream(new FileOutputStream("output.txt"));
System.setOut(out);