📄 testthreadmethod.java
字号:
/*
* TestThreadMethod.java
*
* Created on 2006年10月19日, 下午12:10
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package example9_7;
/**
*
* @author Administrator
*/
public class TestThreadMethod extends Thread{
/** Creates a new instance of TestThreadMethod */
public TestThreadMethod() {
}
public static int shareVar = 0;
public TestThreadMethod(String name){super(name);}
public synchronized void run(){
for(int i=0; i<4; i++){
System.out.print(Thread.currentThread().getName());
System.out.println(" : " + i);
Thread.yield();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -