Thread Class
Package: java.lang
The Thread
class lets you create an object that can be run as a thread in a multithreaded Java application.
Note that an alternative to using the Thread
class to crate multithreaded applications is to use the Runnable
interface. For more information, see Runnable Interface.
Constructors
Constructor |
Description |
|
Creates an instance of the |
|
Creates a |
|
Turns any object that implements an API interface called |
|
Creates a thread from any object that implements |
Methods
Method |
Description |
|
Returns the number of active threads. |
|
Fills the specified array with a copy of each active thread. The return value is the number of threads added to the array. |
|
Returns the name of the thread. |
|
Returns the thread’s priority. |
|
Interrupts this thread. |
|
Checks whether the thread has been interrupted. |
|
Sets the thread’s priority. |
|
Get Java For Dummies Quick Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.