java daemon threads

前端 未结 4 1621
春和景丽
春和景丽 2021-01-22 06:45

Hi all, will daemon thread stop working when the enclosing it thread will finish? Or daemon thread will stop when the \"main\" thread will finish?

I tested this example

4条回答
  •  不要未来只要你来
    2021-01-22 06:58

    The Daemon Thread stopped working due to the fact that there weren't any non-daemon threads left and NOT because the parent thread completed.

提交回复
热议问题