?? threadpri.java
字號:
public class ThreadPri
{
public static void main(String args[ ])
{
MyThread th[ ]=new MyThread[3];
for(int i=0;i<3;i++)
th[i]=new MyThread( );
for(int i=0;i<3;i++)
th[i].start( );
th[0].setPriority(Thread.MAX_PRIORITY);
th[2].setPriority(Thread.MIN_PRIORITY);
}
}
class MyThread extends Thread
{
public void run( )
{
for(int i=0;i<2;i++)
System.out.println(getName( )+"線程的優先級是:\t"+getPriority( )+"。");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -