스레드 생성과실행-2 강의에서
39
임다정
작성한 질문수 63
0
문제와풀이 마지막문제인데요
package thread.test;
import static thread.util.MyLogger.log;
public class StartTest4Main {
public static void main(String[] args) {
Runnable runnable1 = new Runnable() {
@Override
public void run() {
log("A");
}
};
Runnable runnable2 = new Runnable() {
@Override
public void run() {
log("B");
}
};
for (; ; ) {
Thread threadA = new Thread(runnable1);
threadA.setName("Thread-A");
threadA.start();
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
Thread threadB = new Thread(runnable2);
threadB.setName("Thread-B");
threadB.start();
try {
Thread.sleep(500);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
}저는 코드를 이렇게 구현했는데 틀린걸까요?
답변 0
상금은 언제 받을 수 있나요?
2
20
0
17강 강의에 목데이터 첨부파일이 없습니다.
2
68
2
Issuance 테이블에 status, couponId 인덱스가 꼭 필요할까요?
2
17
1
화면 깜박임 현상
2
61
1





