I've noticed many times that when I have a certain line throwing an exception, if I put sysout's before it I will get a strange ordering of text in the console:
I get the first line of the exception, say java.lang.ArrayIndexOutOfBoundsException: -1 followed by the sysout line which is then followed by the rest of the stacktrace. If I have multiple sysouts, the previous ones will go above the Exception name.
java.lang.ArrayIndexOutOfBoundsException: -1 hello world at line 5 at line 6 ...
Why does this happen?