Interview Questions

What is Thread in java?

Java Interview Questions and Answers (part 4)


1. What is Thread in java?

Threads consumes CPU in best possible manner, hence enables multi processing. Multi threading reduces idle time of CPU which improves performance of application.
Thread are light weight process.
A thread class belongs to java.lang package.
We can create multiple threads in java, even if we don’t create any Thread, one Thread at least do exist i.e. main thread.
Multiple threads run parallely in java.
Threads have their own stack.
Advantage of Thread : Suppose one thread needs 10 minutes to get certain task, 10 threads used at a time could complete that task in 1 minute, because threads can run parallely.

(Continued on next question...)

Other Interview Questions