I have never been too familiar with Thread multithreading. I learned some things today. Could you please share with me ~ To implement multithreading in Java, there are two methods: Inheriting the Thread class and implementing the Runable interface. For directly inheriting the Thread class, the general framework of the code is: [java] class name extends Thread {method 1; method 2 ;... Public void run () {// other code...} Attribute 1; Attribute 2 ;...} Here is a simple small example to help you understand it ~ The clock is output once every 1 s: [java] import java. util. date; public class ClockThreadTest {public static void main (String [] args) {ClockThread clockThread = new ClockThread (); clockThread. start (); System. out. println ("End") ;}} class ClockThread extends Thread {@ Override public void run () {super. run (); while (true) {System. out. println (new Date (); try {Thread. sleep (1000);} catch (InterruptedException e) {e. printS TackTrace () ;}}} output result :.... endless output .... note: although the start () method is called here, the main body of the run () method is actually called. So: Why can't we directly call the run () method? In my understanding, the running of a thread requires support from the local operating system. However, this method has its drawbacks. In this example, ClockThread cannot be used if it has other parent classes. Because Java does not allow several parent classes at the same time. The following describes the following method: to implement the Runnable interface, the general framework is: [java] class name implements Runnable {method 1; method 2 ;... Public void run () {// other code...} Attribute 1; Attribute 2 ;...}