A thread--sometimes called an execution context or a lightweight process--is a single sequential flow of control within a program. You use threads to isolate tasks.
Basic support for threads in all versions of the Java
platform is in the java.lang.Thread
class. It provides a thread API and all the generic behavior for threads. These
behaviors include starting, sleeping, running, yielding, and having a priority.
To implement a thread using the Thread class, you need to provide it with a run method
that performs the thread’s task.
Once you know how to get a Thread to do something, you
need to understand its life cycle.
A thread's priority affects when it runs in relation to other threads. This section talks about how this affects your programs.