?? 80438435095e001d1252ee1b24728ede
字號(hào):
package notepad;
public class ThreadPriorityDemo {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Thread t1=new MyThread("線程1:");
t1.setPriority(Thread.MIN_PRIORITY);
t1.start();
Thread t2=new MyThread("線程2:");
t2.setPriority(5);
t2.start();
Thread t3=new MyThread("線程3:");
t3.setPriority(Thread.MAX_PRIORITY);
t3.start();
}
}
class MyThread extends Thread{
String strMsg;
public MyThread(String Message)
{
this.strMsg=Message;
}
public void run()
{
for(int i=0;i<3;i++)
{
System.out.println(strMsg+this.getPriority());
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -