Sumant Mehta wrote:how setIn() and setOut() works.
If you look at the source code for the System class (there's a src.zip in your JDK installation), you will see that those methods actually call native code, so how it works is operating system dependent.