Hi Guys,
Using the below example we can redirect the out put of the System.out.println().
Using the below example we can redirect the out put of the System.out.println().
public
class
ChangeOut {
public static void main(String args[]) { |
try { |
System.setOut( new PrintStream( new FileOutputStream( "log.txt" ))); |
System.out.println( "Now the output is redirected!" ); |
} catch (Exception e) {} |
} |
}
Thanks
Rajesh Kumar yuvaraj
No comments:
Post a Comment