Oracle Upgrade to Java SE 7 Programmer - 1Z1-805무료 덤프문제 풀어보기
View the Exhibit:

Given the following code fragment: class Finder extends SimpleFileVisitor<Path> { private final PathMatcher matcher; private static int numMatches = 0;
Finder() {
matcher = FileSystems.getDefault().getPathMatcher("glob:*java");
}
void find(Path file) {
Path Name = file.getFileName();
if (name != null && matcher.matches(name)) {
numMatches++;
}
}
void report()
{
System.out.println("Matched: " + numMatches);
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
find(file);
return CONTINUE;
}
}
public class Visitor {
public static void main(String[] args) throws IOException {
Finder finder = new Finder();
Files.walkFileTree(Paths.get("d:\\Project"), finder);
finder.report();
}
}
What is the result?

Given the following code fragment: class Finder extends SimpleFileVisitor<Path> { private final PathMatcher matcher; private static int numMatches = 0;
Finder() {
matcher = FileSystems.getDefault().getPathMatcher("glob:*java");
}
void find(Path file) {
Path Name = file.getFileName();
if (name != null && matcher.matches(name)) {
numMatches++;
}
}
void report()
{
System.out.println("Matched: " + numMatches);
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
find(file);
return CONTINUE;
}
}
public class Visitor {
public static void main(String[] args) throws IOException {
Finder finder = new Finder();
Files.walkFileTree(Paths.get("d:\\Project"), finder);
finder.report();
}
}
What is the result?
정답: B
설명: (Fast2test 회원만 볼 수 있음)
Given the code fragment: SimpleDateFormat sdf = new SimpleDateFormat("zzzz", Locale.US);
System.out.println ("Result: " + sdf.format(today) ) ;
What type of result is printed?
System.out.println ("Result: " + sdf.format(today) ) ;
What type of result is printed?
정답: D
Given the incomplete pseudo-code for a fork/join framework applications:
submit (Data) { if (Data.size < SMALL_ENOUGH) { _________(Data); // line X } else { List<Data> x = _________________(Data); // line Y for(Data d: x ______________(d); // line Z } }
And give the missing methods:
Process, submit, and splitInHalf
Which three insertions properly complete the pseudo-code?
submit (Data) { if (Data.size < SMALL_ENOUGH) { _________(Data); // line X } else { List<Data> x = _________________(Data); // line Y for(Data d: x ______________(d); // line Z } }
And give the missing methods:
Process, submit, and splitInHalf
Which three insertions properly complete the pseudo-code?
정답: E,F,G
설명: (Fast2test 회원만 볼 수 있음)
Which statement is true about the take method defined in the WatchService interface?
정답: C
설명: (Fast2test 회원만 볼 수 있음)
Which method or methods should you implement to create your own implementation of the java.nio.file.PathMatcher interface?
정답: B
설명: (Fast2test 회원만 볼 수 있음)
Given the following code fragment:
public static void getInfo() {
//insert code here
List fontCatalog = new ArrayList();
fontCatalog.add("Algerian");
fontCatalog.add("Cambria");
fontCatalog.add("Lucida Bright");
category.put("firstCategory",fontCatalog);
List entrySet = new ArrayList(category.entrySet());
Iterator it = entrySet.iterator();
while(it.hasNext()) {
System.out.println(it.next));
}
}
Which two code fragments, when inserted independently at line **, enable the code to compile?
public static void getInfo() {
//insert code here
List fontCatalog = new ArrayList();
fontCatalog.add("Algerian");
fontCatalog.add("Cambria");
fontCatalog.add("Lucida Bright");
category.put("firstCategory",fontCatalog);
List entrySet = new ArrayList(category.entrySet());
Iterator it = entrySet.iterator();
while(it.hasNext()) {
System.out.println(it.next));
}
}
Which two code fragments, when inserted independently at line **, enable the code to compile?
정답: A,D
설명: (Fast2test 회원만 볼 수 있음)
Given the fragment:
public class CustomerApplication {
public static void main (String [] args) {
CustomerDAO custDao = new CustomerDAOMemoryImp1 ();
// . . . other methods
} }
Which two valid alternatives to line 3 would decouple this application from a specific implementation of customerDAO?
public class CustomerApplication {
public static void main (String [] args) {
CustomerDAO custDao = new CustomerDAOMemoryImp1 ();
// . . . other methods
} }
Which two valid alternatives to line 3 would decouple this application from a specific implementation of customerDAO?
정답: A,B
설명: (Fast2test 회원만 볼 수 있음)
Which two fragments can be combined into a statement that returns an ExecuteService instance?
정답: A,B
설명: (Fast2test 회원만 볼 수 있음)
Consider the following five methods:

Which method should you use to connect to a java Db database with JDBC 4.0, but not with
previous versions of JDBC?

Which method should you use to connect to a java Db database with JDBC 4.0, but not with
previous versions of JDBC?
정답: B
설명: (Fast2test 회원만 볼 수 있음)