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...

Difference between ?System.out.println?
and ?System.error.println??

Answer Posted / k.v.subrahmnyareddy

We can redirect System.out to another file but we cannot
redirect System.err stream.

ex:
public class TestSystOutAndErr
{
public static void main(String[] args)
{
System.out.println("system.out.message");
System.err.println("system.err.message");
}
}
compile:
>javac TestSystOutAndErr.java

execute:(first time)

>java TestSystOutAndErr

OutPut:
system.out.message
system.err.message

execute:(second time)

>java TestSystOutAndErr > samp.txt

output:
system.err.message
(In the above execution "system.out.message" redirected in
to samp.txt file but "system.err.message" not redirected
into samp.txt file)

request:

hi,
I'm M.C.A studet if there is an wrong plz excuse me.
tnaq

Is This Answer Correct ?    7 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What happens when I use / and % with a negative numerator?

1009


What is an infinite loop in java? Explain with an example.

988


What are the differences between stringbuffer and stringbuilder?

1012


how do I create a runnable with inheritance? : Java thread

949


What is the use of volatile in java?

1012


What is equlas() and hashcode() contract in java? Where does it used?

1074


What is covariant return type?

1072


What are the three parts of a lambda expression?

960


What is the method overriding?

1055


enlist some features of jdk.

912


What is jagged array in java?

1024


What are the important methods of java exception class?

1043


What is ternary operator in java?

1026


Define iterator and methods in iterator?

925


What does i ++ mean in Java?

905