View Single Post
Go4Expert Member
27Jan2011,17:03  
alpha34's Avatar
printstream is output stream object it should be directly used with println() or print() and u r trying to set a object which is a stream "System.setOut(ps);" before doing tht casting of ps object is to be done cast ps to string by using toString() and then set output....code will be same but some changes
PrintStream ps;
System.out.println("a");
ps.toString();
System.setOut(ps);

try this....it might work but im bit unsure of use of printstream as i said its a output object and it has it's own syntax..