System.out.println and System.err.println out of order

后端 未结 7 1141
灰色年华
灰色年华 2020-11-22 03:44

My System.out.println() and System.err.println() calls aren\'t being printed to the console in the order I make them.

public static         


        
7条回答
  •  梦如初夏
    2020-11-22 04:09

    This is a bug in Eclipse. It seems that Eclipse uses separate threads to read the content of out and err streams without any synchronization.

    If you compile the class and execute it in the console (with the classic java

    ), the order is as expected.

提交回复
热议问题