Java Multithreading Question and Answers
| 1. | What is a thread? |
|---|---|
| A thread is a set of instructions executing apart from other threads (with its own stack) but sharing the same memory space (with the same heap). | |
| 2. | How can we create a thread in java? |
|---|---|
| There are two ways to create a thread in java – first by implementing runable interface and then creating a thread object from it and second is to extend the thread class. | |
| 3. | What is the difference between user thread and daemon thread? |
|---|---|
|
|
| 4. | When is a thread created? |
|---|---|
|
|