Creating a Thread
Two ways to create a Thread:
- 1. Implement Runnable,
- Implement the run() method.
- 2. Extend Thread,
- Override the run() method.
-
This is due to single inheritance in Java. Extending Thread means you cannot extend another class. The first alternative is more used.