?? ???? ??? ????: System.out.println. ??? ?? ???? ?? ?????? ?? ??? ? ??? ?? ??? ???????.
???out? System ???? ???? ??? ??????? ?????. Out? ??? null ?????. ?? ???? ? ?? ??? PrintStream ????? println() ???? ??? ?? ????. ??? ??? ???? ????
??? ??: ??? ?? http://www.cnblogs.com/skywan...
jdk7 ?? ?? ?? https://luckytoilet.wordpress...
???? ???, ?? ??? ???? ??? ?, ? ??? ???? ??????? ???? ?? ?? ???? ?? ???????? ??? System.out.println ?? ??? ? , System ???? ???? ??? ????????!
?? {
???}
? ?? ???? ???? ???? ?? ???SystemClass ???? ????? ??? ?? ????. ? ???? ??? ?? ????? ???.
private static Native void setOut0(PrintStream out)? ?? ??????.
?? ??? ?? ? ? ?? ??? ??? ???? ??? ????? ??? ??????. ?? ?? ?? ???? ??
????? ?? ?? ???? ?????.
???, ??? ??? ??? ??? ???() ???? ??????. ? ??? ??? ???? ???? ?? ?????. ?, ?? ?? ?? ??(err out in)? ? ???? ??????.
?? ?? ??? ????.
FileOutputStream fdOut = new FileOutputStream(FileDescriptor.out);
setOut0(newPrintStream(fdOut, props.getProperty("sun.stdout.encoding")) );
setOut0() ??? ?? ???? ???, ??? ???? ??? ? out ??? ??? ?????