ex.printStackTrace(PrintWriter s) is not to print the Hello World. It is used to change the stream of stackTrace being printed.
using
System.setErr(System.out);
you can route all your error...
Type: Posts; User: ankurt
ex.printStackTrace(PrintWriter s) is not to print the Hello World. It is used to change the stream of stackTrace being printed.
using
System.setErr(System.out);
you can route all your error...
It prints a stack trace for this Throwable object on the error output stream that is the value of the field System.err.
--- Update ---
You may use either of the following
...