保存进度!

This commit is contained in:
unknown 2023-11-30 00:47:13 +08:00
parent eec60d9599
commit 12ad1d5a4b
3 changed files with 32 additions and 1 deletions

View File

@ -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()) );
}
}

View File

@ -15,5 +15,7 @@ public class MyThread extends Thread
public void run()
{
super.run();
System.out.println("我是工作线程:" + String.valueOf(Thread.currentThread().getId()) );
}
}

View File

@ -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("我是workingJobID是" + String.valueOf( Thread.currentThread().getId()));
}
}