📄 threadtest.java
字号:
// the usual class does not need public
class CountingThread extends Thread{
public void run()
{
System.out.println("The Thread start:"+this);
for(int i=0;i<9;i++)
System.out.print("i="+(i+1)+"\t");
//if println
//is has enter huan hang de yi si
System.out.println("");
System.out.println("thread stopped :"+this);
}
}
public class ThreadTest{
/**
* Method main
*
*
* @param args
*
*/
public static void main(String[] args) {
// TODO: Add your code here
System.out.println("Starting ThreadTest...");
CountingThread t1=new CountingThread();
t1.start();
CountingThread t2=new CountingThread();
t2.start();
CountingThread t3=new CountingThread();
t3.start();
System.out.println("the test is Done");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -