public static final int | MAX_PRIORITY | 10 |
public static final int | MIN_PRIORITY | 1 |
public static final int | NORM_PRIORITY | 5 |
- /**
- * @(#)TestPriority.java
- *
- *
- * @author
- * @version 1.00 2008/10/10
- */
- public class TestPriority {
- public TestPriority() {
- }
- public static void main(String []args)
- {
- T1 t1=new T1();
- T2 t2=new T2();
- t1.setPriority(NORM_PRIORITY+3);
- t2.start();t1.start();
- }
- }
- class T2 extends Thread
- {
- public void run()
- {
- for( int i=0; i<1000; i++)
- System.out.println("-----t2 "+i);
- }
- }
- class T1 extends Thread
- {
- public void run()
- {
- for( int i=0; i<1000; i++)
- System.out.println("t1 "+i);
- }
- }