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
Explain when noclassdeffounderror will be raised ?
How to do encapsulation in java?
What are the 3 types of control structures?
Explain about collection interface in java?
For ease of programming you can consider the maze as a 2D array with colors represented by below integer and characters (in capital letters). • B - Black • W -White • G- Green • R- Red R B W B W W W W W W B W B B W W W W W W W B W B W W W B W W W W B B W W W B W W W B W W B B B B W B W B W W B W W W B W W W B B B W W B W W W B W W B W B W W W B W B W W W W B B W W W W B W W W W W G Shortest Route Problem: • Solution that finds the shortest Route between Red and Green White will have 1 Weight. Red and Green carry no weights. Shortest path is the path with less weight when you add up the weights in the path.
What is the use of parseint in java?
What is lazy initialization in java?
What is Java Reflection API? Why it’s so important to have?
What is downcasting?
What are the advantages of passing this into a method instead of the current class object itself?
State two differences between C and Java.
What are methods of a class?
What is linked hashmap and its features?
Can we write a class without main method in java?
When to use runnable interface vs thread class in java?