Java Threading Question and Answers
17. | What are the difference between extending the Thread class and implementing the Runnable interface? |
---|---|
|
|
18. | What is Executors class? |
---|---|
|
|
19. | What are the uses of synchronized keyword? |
---|---|
|
|
20. | How does multi threading take place on a computer with a single CPU? |
---|---|
The operating system's task scheduler allocates execution time to multiple tasks. By quickly between executing tasks, it creates the impression that tasks execute sequentially. | |