package Week8;
public class MyThread extends Thread {
public void run(){
for(int i = 0;i<5;i++)
System.out.println("运行One线程次数"+(i+1));
}
public static void main(String[] args) {
MyThread One = new MyThread();
One.start(); //启动线程进入running模式
}
}
一个简单的线程示例
最新推荐文章于 2022-07-09 17:41:06 发布