A thread is a flow of execution through the process code, with its own program counter that keeps track of which instruction to execute next, system registers which hold its current working variables, and a stack which contains the execution history.
Using multiple thread we can perform multi tasking in java. Means more than one programs can execute parallel.
So in java we can perform multiple tasks using single java program , by dividing a programs into number of threads and one thread will be able to perform one individual task.
So in java a thread comprises following things.
1. Thread Id
2. Program counter
3. Java Stack