Below are the two ways for creating a thread in Java
The two ways to create a thread are:
• Implement the Runnable interface.
• Extend the Thread