How to run a task once every Threads finished running in Java?

前端 未结 0 829
梦毁少年i
梦毁少年i 2021-01-23 21:18

I have a loop which create a new Thread on each iteration, like so:

for(int i = 0; i < REPEAT; i++) {
    new Thread(new MyTask(i)).start();
    Thread.sleep(1         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题