package com.shrimpking.t8;
/**
* Created by IntelliJ IDEA.
*
* @Author : Shrimpking
* @create 2024/10/1 18:59
*/
public class AsyncMultThread9_6
{
public int a = 0; //属性
public static void main(String[] args) throws InterruptedException
{
AsyncMultThread9_6 amt = new AsyncMultThread9_6();
Thread th = new Thread(new Runnable()
{
@Override
public void run()
{
for (int i = 0; i < 5; i++)
{
amt.a++;
}
}
});
th.start();
//th.join(); //加入主线程
System.out.println(amt.a);
}
}
AsyncMultThread9_6
最新推荐文章于 2025-01-16 23:49:26 发布
17

被折叠的 条评论
为什么被折叠?



