1Z1-805 무료 덤프문제 온라인 액세스
시험코드: | 1Z1-805 |
시험이름: | Upgrade to Java SE 7 Programmer |
인증사: | Oracle |
무료 덤프 문항수: | 90 |
업로드 날짜: | 2025-08-26 |
Given:
public class MyGrades {
private final List<Integer> myGrades = new ArrayList<Integer>();
private final ReadWriteLock rwlock = new ReentrantReadWriteLock();
public void addGrade(Integer grade) {
/*
lock and modify
*/
}
public void averageGrades() {
// acquire _______ lock Line **
double sum = 0;
int i = 0;
for (i = 0; i < myGrades.size(); i++) {
sum += myGrades.get(i);
}
// release __________ lock Line ***
System.out.println("The average is: " + sum/(i+1));
}
}
Which pair's statements should you insert at line ** and line *** (respectively) to acquire and release the most appropriate lock?
The default file system includes a logFiles directory that contains the following files:
log - Jan2009
log_01_2010
log_Feb2010
log_Feb2011
log-sum-2012
How many files the matcher in this fragment match?
PathMatcher matcher = FileSystems.getDefault ().getPathMatcher ("glob:???_*1");