Thread class includes a lot of useful methods. But we will focus only on the most important ones. When you are writing a multithreaded application in most cases you will need to use some of them. Thread class include the following important methods:

  • Thread.**currentThread**()
  • long **getId**()
  • int **getPriority**()
  • Thread.State **getState**()
  • void **interrupt**()
  • void **join**()
  • void **run**()
  • void **setDaemon**(boolean on)
  • void **setPriority**(int newPriority)
  • static void **sleep**(long millis)
  • void **start**()
  • static void **yield**()

#java #software-engineering #concurrency #programming #software-development

Java Concurrency: Thread methods
2.10 GEEK