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.
- 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 parallel.
- 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 parallel in java.
- Threads have their own stack.
No comments:
Post a Comment