Why is the java Thread.interrupted method static? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why is the java Thread.interrupted method static?

Can someone explain to me why the Thread.interrupted method is a class method? I already know the difference between the interrupted and isInterrupted methods. Both get the interrupt flag and the interrupted method also deletes the interrupt flag. But why exactly is it static?

2nd Feb 2022, 7:31 PM
TOBI.ON
TOBI.ON - avatar
1 Answer
0
becsuse only one thread is current thread
2nd Feb 2022, 9:05 PM
zemiak