?? thread2.java
字號:
package thread;
/*實驗第2題*/
public class Thread2{
public static void main(String args[])
{
Thread3 thread[]=new Thread3[10];
int th=0;
for(int i=1;i<=4;i++)
{
thread[i]=new Thread3(i);
thread[i].start();
}
try{
System.out.print("請輸入要停止的線程數:");
th=System.in.read();
// System.out.print(""+th);
th=th-48;
}catch(Exception e2){}
thread[th].setflag();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -