保存进度!
This commit is contained in:
		@@ -9,10 +9,19 @@
 | 
			
		||||
 */
 | 
			
		||||
package com.cpic.xim;
 | 
			
		||||
 | 
			
		||||
import com.cpic.xim.utils.MyThread;
 | 
			
		||||
import com.cpic.xim.utils.MyWorkingJob;
 | 
			
		||||
 | 
			
		||||
public class App 
 | 
			
		||||
{
 | 
			
		||||
    public static void main( String[] args )
 | 
			
		||||
    {
 | 
			
		||||
        System.out.println( Thread.currentThread().getName() );
 | 
			
		||||
        MyThread workThread = new MyThread();
 | 
			
		||||
        Thread jobThread = new Thread( new MyWorkingJob() );
 | 
			
		||||
 | 
			
		||||
        workThread.start();
 | 
			
		||||
        jobThread.start();
 | 
			
		||||
 | 
			
		||||
        System.out.println( "我是主线程!" + String.valueOf(Thread.currentThread().getId()) );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -15,5 +15,7 @@ public class MyThread extends Thread
 | 
			
		||||
    public void run()
 | 
			
		||||
    {
 | 
			
		||||
        super.run();
 | 
			
		||||
 | 
			
		||||
        System.out.println("我是工作线程:" + String.valueOf(Thread.currentThread().getId()) );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,20 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Kane
 | 
			
		||||
 * @Date: 2023-11-30 00:42:41
 | 
			
		||||
 * @LastEditors: Kane
 | 
			
		||||
 * @FilePath: /MultiThread/src/main/java/com/cpic/xim/utils/MyWorkingJob.java
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 * 
 | 
			
		||||
 * Copyright (c) ${2023} by Kane, All Rights Reserved. 
 | 
			
		||||
 */
 | 
			
		||||
package com.cpic.xim.utils;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
public class MyWorkingJob implements Runnable
 | 
			
		||||
{
 | 
			
		||||
    @Override
 | 
			
		||||
    public void run()
 | 
			
		||||
    {
 | 
			
		||||
        System.out.println("我是workingJob,ID是" + String.valueOf( Thread.currentThread().getId()));
 | 
			
		||||
    }
 | 
			
		||||
} 
 | 
			
		||||
		Reference in New Issue
	
	Block a user