@Override
public void run() {
= reg.();
if ( == 1) {
= 0 ;
System.out.println("3333333");
System.out.println();
} else if ( == 2) {
= 0;
System.out.println("444444444444444");
}
try {
Thread.sleep(300);
} catch (Exception e) {
e.printStackTrace();
}
run();
}执行效果如下
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
TIMED_WAITING
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0本人不明白 明明是0 为什么还进入
if ( == 1) {
= 0 ;
System.out.println("3333333");
System.out.println();
}
这个if 结构
public void run() {
= reg.();
if ( == 1) {
= 0 ;
System.out.println("3333333");
System.out.println();
} else if ( == 2) {
= 0;
System.out.println("444444444444444");
}
try {
Thread.sleep(300);
} catch (Exception e) {
e.printStackTrace();
}
run();
}执行效果如下
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
TIMED_WAITING
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0
3333333
0本人不明白 明明是0 为什么还进入
if ( == 1) {
= 0 ;
System.out.println("3333333");
System.out.println();
}
这个if 结构
解决方案 »
- richfaces3.3.1实现行拖动进行排序?
- Struts2可以用actionForm吗?如果要用怎么办?
- struts2配置问题,出现404的错误
- 如何用JavaScript 向table中插入图片,
- 关于 JasperReport 的问题(客户端与apply交互问题)
- JSF中Tree组件,Bean中实例化对象的时候,出现问题?
- 请问学习struts是不是要先学会jsp标签库呢?
- weblogic7.0 在windows98第二版中不能启动
- 大家有没有见过这种乱码问题???
- 请问在EJB中如何调用COM组件
- KO众多高手的jdbc问题--请谨慎模仿
- 求Hibernate的映射文件的写法,另外讨论一种数据库设计方案
在走道这条语句“if ( == 1)”时,成立,然后进入if块,“ = 0 ”把 设为0,System.out.println("3333333")打印3333333,System.out.println()打印,这时候已经是0了
再调线程时重复以上操作