Java Multithreading Interview Questions and Answers
Question: Explain the difference between Thread and Runnable.Answer: Thread is a class in Java that provides methods to create and perform operations on a thread. Runnable is an interface that must be implemented by a class to be executed by a thread.Example:
|
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Is it helpful? Yes No
Most helpful rated by users:
- What is multithreading?
- What is the purpose of the yield() method?
- What is the purpose of the sleep() method in Java?
- How do you create a thread in Java?
- Explain the difference between Thread and Runnable.