I know that I have learned programming through multiple threads, but now I really understand what he is used. It is like dividing a project into different directions, running the implementation at the same time, and finally finishing in the main direction. This achieves high efficiency and low consumption. The system time is displayed every second. This project is easy but can easily lead to an endless loop and the program cannot be jumped out, so we can easily implement it using multiple threads: [html] public class ClockThreadTest {/*** @ param args */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. printStackTrace () ;}www.2cto.com }}do you see the specific embodiment of the thread? Every second shows that the system time is multi-thread, while the end is in the main thread. In this way, there will be no endless loops.