What are two different ways used to implement threading in Java ? Explain with example.
Answers
Answered by
0
hey there
Multithreading is a Java feature that allows concurrent execution of two or more parts of a program for maximum utilization of CPU. Each part of such program is called a thread. So, threads are light-weight processes within a process.
Threads can be created by using two mechanisms :
1. Extending the Thread class
2. Implementing the Runnable Interface
hope it help
Similar questions