?? testthreadpriority.java
字號(hào):
public class testThreadPriority{
public static void main(String arg[]){
myThread A=new myThread("A",3);
myThread B=new myThread("B",9);
myThread C=new myThread("C",5);
A.start();
B.start();
C.start();
try{
A.join();
B.join();
C.join();
}catch(InterruptedException e){}
}
}
class myThread extends Thread{
String Name;
int Priority;
myThread(String Name,int Priority){
this.Name=Name;
this.Priority=Priority;
this.setPriority(Priority);
}
public void run(){
System.out.println("線程"+Name+"啟動(dòng),優(yōu)先級(jí)數(shù)是:"+Priority);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -