File file = new File("c:/a.txt");
PrintStream fi = null;
try {
fi = new PrintStream(file);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.setOut(fi);
PrintStream fi = null;
try {
fi = new PrintStream(file);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.setOut(fi);