Why is the java Thread.interrupted method static? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 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 Antwort
0
becsuse only one thread is current thread
2nd Feb 2022, 9:05 PM
zemiak