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
Add a value x to array from index l to r where 0 <= l <= r <= n-1
When a byte datatype is used?
What is object class in java?
When can an object reference be cast to an interface reference in java programming?
What is an empty list in java?
Name component subclasses that support painting in java programming?
extending thread class or implementing runnable interface. Which is better? : Java thread
What one should take care of, while serializing the object?
Which number is denoted by leading 0x or 0x in java?
How are variables stored?
Why hashcode is used in java?
Can we extend a class with private constructor?
If two threads have same priority which thread will be executed first ?
What are static methods?
What is a stringbuffer?