I'm trying to print output and an error message to the console. but sometimes the sequence of output changes, first it prints the error message & then it prints the simple message can anybody help me understand why is it happening as such? the sequence of output changes most of the time. There is no consistency in the printed output. I'm using eclipse IDE & the output I get is as follows.
I have tried to print the following code,
System.out.println("simple message");
System.err.println("error message");
the expected result is this:
simple message
error message
but the actual result is this:
error message
simple message