Total WebSite Views Count

Java Thread Methods

Java Thread Methods



Modifier and TypeMethodDescription
voidstart()It is used to start the execution of the thread.
voidrun()It is used to do an action for a thread.
static voidsleep()It sleeps a thread for the specified amount of time.
static ThreadcurrentThread()It returns a reference to the currently executing thread object.
voidjoin()It waits for a thread to die.
intgetPriority()It returns the priority of the thread.
voidsetPriority()It changes the priority of the thread.
StringgetName()It returns the name of the thread.
voidsetName()It changes the name of the thread.
longgetId()It returns the id of the thread.
booleanisAlive()It tests if the thread is alive.
static voidyield()It causes the currently executing thread object to pause and allow other threads to execute temporarily.
voidsuspend()It is used to suspend the thread.
voidresume()It is used to resume the suspended thread.
voidstop()It is used to stop the thread.
voiddestroy()It is used to destroy the thread group and all of its subgroups.
booleanisDaemon()It tests if the thread is a daemon thread.
voidsetDaemon()It marks the thread as daemon or user thread.
voidinterrupt()It interrupts the thread.
booleanisinterrupted()It tests whether the thread has been interrupted.
static booleaninterrupted()It tests whether the current thread has been interrupted.
static intactiveCount()It returns the number of active threads in the current thread's thread group.
voidcheckAccess()It determines if the currently running thread has permission to modify the thread.
static booleanholdLock()It returns true if and only if the current thread holds the monitor lock on the specified object.
static voiddumpStack()It is used to print a stack trace of the current thread to the standard error stream.
StackTraceElement[]getStackTrace()It returns an array of stack trace elements representing the stack dump of the thread.
static intenumerate()It is used to copy every active thread's thread group and its subgroup into the specified array.
Thread.StategetState()It is used to return the state of the thread.
ThreadGroupgetThreadGroup()It is used to return the thread group to which this thread belongs
StringtoString()It is used to return a string representation of this thread, including the thread's name, priority, and thread group.
voidnotify()It is used to give the notification for only one thread which is waiting for a particular object.
voidnotifyAll()It is used to give the notification to all waiting threads of a particular object.
voidsetContextClassLoader()It sets the context ClassLoader for the Thread.
ClassLoadergetContextClassLoader()It returns the context ClassLoader for the thread.
static Thread.UncaughtExceptionHandlergetDefaultUncaughtExceptionHandler()It returns the default handler invoked when a thread abruptly terminates due to an uncaught exception.
static voidsetDefaultUncaughtExceptionHandler()It sets the default handler invoked when a thread abruptly terminates due to an uncaught exception.

AWS Services

AWS Services

Technology Selection & Evaluation Criteria

Technology Selection & Evaluation Criteria

Scale Cube - Scale In X Y Z Cube

Scale Cube - Scale In X Y Z Cube

Feature Post

AWS Services

About Me

About Me

Spring Cloud

Spring Cloud
Spring Cloud

Spring Cloud +mCloud Native + Big Data Archittect

Spring Cloud +mCloud Native + Big Data Archittect

ACID Transaction

ACID Transaction

Data Pipe Line Stack

Data Pipe Line Stack

Popular Posts