Difference between ?System.out.println?
and ?System.error.println??
Answer Posted / 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.out.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 ? | 13 Yes | 8 No |
Post New Answer View All Answers
Define jit compiler?
What do you mean by singleton class in java?
What is formatted output?
What is vector?
What is parameters example?
Why does abstract class have constructor?
Does printwriter create a file?
Is 0 an even number?
What’s the difference between callable and runnable?
Define how can we find the actual size of an object on the heap?
What is final method in java?
Can a method be static?
What is regex java?
How can constructor chaining be done by using the super keyword?
What is the structure of java?