본문 바로가기
  • think normal
새로워지기/서른의 생활코딩

ex9) java_thread

by 청춘만화 2012. 3. 4.

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());
}

}

'새로워지기 > 서른의 생활코딩' 카테고리의 다른 글

ex11) java_thread  (0) 2012.03.04
ex10) java_thread  (0) 2012.03.04
ex8) java_thread  (0) 2012.03.04
ex7) java_thread  (0) 2012.03.04
ex6) java_thread  (0) 2012.03.04

댓글