QUOTE
Threads
One thing to consider in Java programming is how system resources are being used.
Graphics, complex mathematical computations, and other intensive tasks can take up a
lot of processor time.
This is especially true of programs that have a graphical user interface, which is a style
of software that you’ll be learning about next week.
If you write a graphical Java program that is doing something that consumes a lot of the
computer’s time, you might find that the program’s graphical user interface responds
slowly—drop-down lists take a second or more to appear, button clicks are recognized
slowly, and so on.
To solve this problem, you can segregate the processor-hogging functions in a Java class
so that they run separately from the rest of the program.
This is possible through the use of a feature of the Java language called threads.
Threads are parts of a program set up to run on their own while the rest of the program
does something else. This also is called multitasking because the program can handle
more than one task simultaneously.
Threads are ideal for anything that takes up a lot of processing time and runs continuously.
By putting the workload of the program into a thread, you are freeing up the rest of the
program to handle other things. You also make handling the program easier for the virtual
machine because all the intensive work is isolated into its own thread.
from teach your self java in 21 days
if u want the whole chapter pm me