**************************************************************
COMPLETE SOURCE CODE FOR : PutCommandPromptOutputToFile.java
**************************************************************
import java.io.PrintStream;
public class PutCommandPromptOutputToFile
{
public static void main(String[]args)
{
try
{
PrintStream newOuputChannel=new PrintStream("output.txt");
System.setOut(newOuputChannel);
System.out.println("HI");
}
catch(Exception exception)
{
exception.printStackTrace();
}
}
}
**************************************************************
JUST COMPILE AND EXECUTE IT
**************************************************************