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
What was java originally called?
What is a cup of java?
How to split arraylist elements in java?
What is sorting in java?
Find the value of a specified element of the array arr[i] where 0 <= i <= n-1
What's the difference between comparison done by equals method and == operator?
Are maps ordered java?
Can you explain inner class.
Can a constructor call another constructor?
What is the purpose of garbage collection in java, and when is it used?
explain different ways of using thread? : Java thread
Can we split string with in java?
How do you create a null object?
What is return type in java?
What is parsing in grammar?