Getting different thread order even time I run my program

后端 未结 3 1878
醉梦人生
醉梦人生 2021-01-22 09:28

can someone tell me the order in which a thread starts to execute?. I have written the following code

class NewThread implements Runnable {
    Thread t;
    New         


        
3条回答
  •  我在风中等你
    2021-01-22 09:50

    There is no implicit order. If you must have an order, use the ExecutorService with a que depth of 1.

提交回复
热议问题