1. Inherit the Thread class.
Source code structure: public class Thread implements Runnable
It can be seen from this that the Thread class implements Runnable. Since multiple inheritance is not supported in Java, the way to implement Runnable can be used when implementing multi-threading.
2. Implement the Runnable interface.