📄 testmainpriority.java
字号:
public class TestMainPriority{ public static final int NUMBER_OF_THREADS = 5; public static void main(String[] args) { SimpleThread[] threads = new SimpleThread[NUMBER_OF_THREADS]; for( int i = 0; i < NUMBER_OF_THREADS; i++ ) { String name = "Thread: " + i; SimpleThread newThread = new SimpleThread( name ); threads[i] = newThread; // If this is the last thread, set it's priority to the maximum // otherwise set the priority of the thread to the minimum if ( i == NUMBER_OF_THREADS ) { newThread.setPriority( Thread.MAX_PRIORITY ); } else { newThread.setPriority( Thread.MIN_PRIORITY ); } } for ( int i = 0; i < NUMBER_OF_THREADS; i++ ) { threads[i].start(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -