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 is static import in java? Explain
What is the difference between serializable and externalizable interfaces?
Write a program to check for a prime number in java?
Explain about strings in java?
What is object-oriented paradigm?
Is 0 an even number?
Can a boolean be null java?
What is diamond operator in java?
What are internal variables?
What is array size in java?
What is function and method in java?
What is Session reduplication and how its done?
How do you define a singleton class?
What is the difference between ArrayList and Vector? which one is better in Java
What are the differences between Java 1.0 and Java 2.0?