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
Can we extend singleton class?
Is arraylist a class in java?
Add a value x to array from index l to r where 0 <= l <= r <= n-1
What is a class reference?
What are some alternatives to inheritance?
What are operators and its types?
How do you define a method?
Why string is not a wrapper class?
What is JDBC Driver interface?How can you retrieve data from the ResultSet
What is the char data type?
How do you replace all in word?
What is Gang of four design patterns
How many types of operators are there?
What is output buffer?
What is the purpose of declaring a variable as final?