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 parsing in grammar?
Is void a type?
What is a jagged array in java?
What is rule of accessibility in java?
What is the difference between dom and sax parser in java?
What is the program compilation process?
Explain tree set and its features?
Is it compulsory for a try block to be followed by a catch block in java for exception handling?
What is a class in java?
Explain about wait() method?
hr interview how many minutes asking question
Explain about data types?
Explain, java is compatible with all servers but not all browsers?
Which software is used for java programming?
Can I declare a class as private?