How could Java classes direct program messages to the
system console, but error messages, say to a file?
Answer Posted / munna
import java.io.*;
class Err
{
public static void main(String[] args) throws Exception
{
PrintStream ps=new PrintStream(new
FileOutputStream("output.txt"));
System.setErr(ps);
System.setOut(ps);
System.out.println("fdffdfdffffff........");
}
}
Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
What is unicode datatype?
What is singleton class in java and how can we make a class singleton?
What are facelets templates?
What are the types of collections in java?
Tell me the Importent classes in net package?
What is the properties class?
Can we convert integer to string in java?
What is the primary benefit of encapsulation?
How do you sort data in java?
What are kinds of processors?
Can we have any other return type than void for main method?
What is compareto?
What is the r character?
What is a finally block? Is there a case when finally will not execute?
What does I ++ mean?