1 Star 0 Fork 0

yirenzhixia/JavaBasic

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
DemoThread.java 587 Bytes
一键复制 编辑 原始数据 按行查看 历史
yirenzhixia 提交于 2018-08-27 10:33 +08:00 . Java基础代码
package thread;
/**
* @author ZwT
* @date 2018-05-21 16:43
**/
public class DemoThread extends Thread{
private int count=10;
private String threadName;
public DemoThread(String threadName){
this.threadName = threadName;
}
@Override
public void run() {
for (int i = 0; i < 5; i++) {
System.out.println(threadName + "运行 : count=" + count--);
try {
sleep((int) Math.random() * 10);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zwtxm/JavaBasic.git
git@gitee.com:zwtxm/JavaBasic.git
zwtxm
JavaBasic
JavaBasic
master

搜索帮助