assume you have a class test1 written with System.err and you have a class test2 written with Sytem.outwhen you try :java test1>>log.txt, you will see the output displayed on the console when you try :java test2>>log.txt, you will never get output ont the console and you can find those output in the log.txtthat's the distinction between them.hope it helps.
you have a class test2 written with Sytem.outwhen you try :java test1>>log.txt, you will see the output displayed on the console
when you try :java test2>>log.txt, you will never get output ont the console and you can find those output in the log.txtthat's the distinction between them.hope it helps.
System.err.println() 是标准错误输出
默认情况下都是将结果输出到控制台,不过可以对其进行重定向从而改变其默认输出的方式。