public multi_Test(String str)
sleep((int)(1000*Math.random()));
catch(InterruptedException e){}
System.out.println(name+" 執行中"+this.getPriority());
public class multi_thread_3
public static void main(String args[])
multi_Test apple=new multi_Test("red");
multi_Test banana=new multi_Test("yellow");
multi_Test grape=new multi_Test("purple");
multi_Test cloud =new multi_Test("white");
multi_Test grass=new multi_Test("green");
apple.setPriority(Thread.MAX_PRIORITY);
banana.setPriority(Thread.MIN_PRIORITY);