Question: How do you create a thread in Java?Answer: You can create a thread by extending the Thread class or implementing the Runnable interface.Example:
|
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.