[JAVA/자바] 쓰레드(Thread) 다루기( Thread상속, Runnable 구현, join)
[JAVA] 쓰레드(Thread)와 런에이블(Runnable) 1편
try {
Thread.sleep();
} catch(InterruptedException e) {
throw new IllegalStateException(e);
}
// 어떤 쓰레드를 인터럽트 시키는지 명확화 필요
try {
Thread.interrupt();
} catch (InterruptedException e) {
e.printStackTrace();
}
// 해당 쓰레드 객체가 종료될 때 까지 이 라인에서 정지
쓰레드객체.join();