System. out. println (); the smelly statement above prints the specified information to the standard output (screen ). Generally, we can see the printed information on the console. What if we want to persist some information, such as storing it in a file? (Every time you re-run the program, the console information will disappear.) One solution is to redirect the output. [Java] public static void setOut (PrintStream out); the setOut method of the System class is used for redirection. A simple example is as follows: [java] import java. io. file; import java. io. printStream; public class Test {public static void main (String args []) throws Exception {System. setOut (new PrintStream (new File ("g: // loggers.txt"); System. out. println ("hehe"); System. out. println (); System. out. println ("qile") ;}} after running, the console does not have any print information: Enter the g, open loggers.txt: The content is as follows: Next: hehe indicates that it is indeed relocated to the file we specified. The other standard error output streams are similar to the output streams.