A thread can be interrupted by Thread.interrupt() if it is a java thread.
We can also create Executor Service with SingleThread and we can call Future.cancel.
Could someone explains the differences between the two?
Future Cancel vs Thread Interrupt
I think you are comparing Apple and Orange. Please check documentation of both.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.