QUESTION 10자격증/OCJP_ExamD2018. 7. 29. 16:41
Table of Contents
반응형
QUESTION 10Given:public class NamedCounter {private final String name;private int count;public NamedCounter(String name) {this.name = name;}public String getName() {return name;}public void increment() {count++;}public int getCount() {return count;}public void reset() {count = 0;}}Which three changes should be made to adapt this class to be used safely by multiple threads? (Choose three.)A. declare reset() using the synchronized keywordB. declare getName() using the synchronized keywordC. declare getCount() using the synchronized keywordD. declare the constructor using the synchronized keywordE. declare increment() using the synchronized keywordSolution : ACE
plus imformation
클래스 내에서 선언된 메서드와 int 변수 동기화 시킨다.
반응형
'자격증 > OCJP_ExamD' 카테고리의 다른 글
QUESTION 12 (0) | 2018.07.30 |
---|---|
QUESTION 11 (0) | 2018.07.30 |
QUESTION 9 (0) | 2018.07.29 |
QUESTION 8 (0) | 2018.07.29 |
QUESTION 7 (0) | 2018.07.29 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상