How to kill a thread immediately from another thread in java?

前端 未结 2 780
时光说笑
时光说笑 2020-12-21 15:46

is there anyway to kill a thread or interrupt it immediately.
Like in one of my thread, i call a method which takes time to execute (2-4 seconds). This method is in a wh

2条回答
  •  一个人的身影
    2020-12-21 16:31

    No, I don't believe there is a way. There's a reason you don't want to do that.

    Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?

提交回复
热议问题