What if in the next bit of code I am going to substitute (new FileWriter
with (new PrintWriter
pw = new PrintWriter(new BufferedWriter(new FileWriter ("xanaduindeed.txt")));
pw = new PrintWriter(new BufferedWriter(new PrintWriter ("xanaduindeed.txt")));
Both of them work fine, however I would like to know which of the two optimize the memory usage. (if either of the two is actually better) Thanks in advance.