It is not necessary to have both.
If you just want the output to go to the file, then use printf, print, or println with the PrintStream object that has been declared and connected to the file.
If you just want the output to go to the console window, then use System.out as the PrintStream so System.out.print...
In our lab, we sent the same output to both the console window and the file. In some of the test practice problems, that is not the case.