img
. . . . . . .
throws SecurityException,
IllegalThreadStateException
These create a new thread object.
References:
Chapters 4 and 10.
MIN_PRIORITY MAX_PRIORITY NORM_PRIORITY
public final static int MIN_PRIORITY = 1;
public final static int MAX_PRIORITY = 10;
public final static int NORM_PRIORITY = 5;
These are the minimum, maximum, and default priorities for normal threads.
Reference:
Chapter 5.
Comment:
You will probably never use these functions.
start
public void start()
throws IllegalThreadStateException
Calling the start() method on an instance of Thread will cause the appropriate run() method
to execute in a new thread.
Chapter 4.
Reference:
run
public void run()
This is the method you define that actually executes the code you want. The base method simply
looks to see if there is a Runnable and calls its run() method.
Chapter 4.
Reference:
currentThread
public static Thread currentThread()
This method returns the current thread object.
Reference:
Chapter 4.
join
public final void join()
public final void join(long milliseconds)
public final void join(long milliseconds, long nanosec)
throws InterruptedException
This waits for the thread to exit.
Reference:
Chapter 4.
Comment:
Rarely used.
stop
public final stop()
Search WWH :
Custom Search
Previous Page
Multithreaded Programming with JAVA - Topic Index
Next Page
Multithreaded Programming with JAVA - Bookmarks
Home