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
What’s the difference between constructors and other methods?
How does singleton class work?
Can we declare a class as static?
Can you sort a list in java?
What is a parameter example?
Which method returns the length of a string?
What is merge sort in java?
What is a text string?
How do you differentiate abstract class from interface?
What is class forname used for?
Explain java coding standards for variables ?
Distinguish between a predicate and a function?
How garbage collection is done in java?
What causes memory leak in java?
What are parsing rules?