Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / biru3121

The 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);

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why java does not support pointers?

1022


What loop means?

945


What are the data types supported by java? What is autoboxing and unboxing?

1005


What is empty list in java?

1066


What are some examples of variable costs?

939


What are the four integer types supported by java?

1025


What do you know about the garbage collector in java?

1079


What is the super void?

894


Which category the java thread do fall in?

987


State some advantages of java?

1218


Do loops java?

1004


When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?

997


what is the difference between yielding and sleeping? : Java thread

957


What is a parameter in a function?

979


Why there are some null interface in java? What does it mean?

1113