WHAT IS A THREAD?
A thread or thread of execution or lightweight
process is a set of instructions within a program that are executed
independently of other parts of the code.
A thread is defined not only by a set of instructions, but also the order
in which those instructions are executed, hence the term thread of
execution. This ordering may be affected by common control statements
such as while and
Java is a multithreaded programming language in that it
contains support for multiple simultaneous threads of execution. This
allows a Java applet or application to perform multiple tasks at the