Search:     Advanced search
Browse by category:
C/C++   |   Java   |   Oracle/Database   |   SAP   |   ASP .NET   |   Mainframe-DB2   |   Freshers

How could Java classes direct program messages to the system console, but error messages, say to a file?

Add comment
Views: 301
Votes: 0
Comments: 0
he class System has a variable out that represents the standard output, and the variable err that represents the standard error device. By default, they both point at the system console. This how the standard output could be re-directed:
Stream st = new Stream(new FileOutputStream("output.txt")); System.setErr(st); System.setOut(st);
Others in this Category
document What is the role of JMS in enterprise solution development?
document What is the difference between static and non-static variables?
document Can the primary key in the entity bean be a Java primitive type such as int?
document What is the purpose of garbage collection in Java, and when is it used?
document What is EJB QL?
document What is the Locale class?
document Explain different way of using thread?
document How can you access structure fields by name at run time?
document Difference between HashMap and HashTable?
document What is the List interface?
» More articles



RSS