청춘만화 2012. 3. 4. 11:01

public class proporty implements Runnable{
public void run() {
for(int i=1;i<21;i++){
System.out.println(Thread.currentThread().getName()+"number="+i);
}
}

public static void main(String[] args) {
ThreadPriority t1 =new ThreadPriority();
Thread first=new Thread(t1,"first");
Thread second=new Thread(t1,"second");
Thread third=new Thread(t1,"third");

System.out.println(first.getName());
System.out.println(second.getName());
System.out.println(third.getName());
System.out.println(Thread.currentThread()+"property"+Thread.currentThread().getPriority());
}

}