//스레드 기본 실습2
public class ThreadEx {
public static void main(String[] args) {
System.out.println(Thread.currentThread().getName()); //main 스레드
//우선권 : 기본은 5
System.out.println(Thread.currentThread().getPriority());
//우선권에 대한 값 (1 ~ 10)
//우선권을 10을 준다고 해서 스레드가 먼저 종료되는 것은 아님
System.out.println(Thread.MAX_PRIORITY);
System.out.println(Thread.NORM_PRIORITY);
System.out.println(Thread.MIN_PRIORITY);
}
}
출력물
main
5
10
5
1
'JAVA' 카테고리의 다른 글
스레드(Thread) 기본 -synchronized(동기화) (0) | 2013.02.06 |
---|---|
스레드(Thread) 기본 실습 -synchronized(동기화) (2) | 2013.02.06 |
스레드(Thread) 기본 실습 (0) | 2013.02.06 |
[실습] 우편번호검색기 (0) | 2013.02.05 |
java.io 패키지 - 객체 직렬화 실습 (0) | 2013.02.05 |