1.
In the Java SE7 API, which method is most commonly used by factories to instantiate objects?
2.
Which method or methods should you implement to create your own implementation of the java.nio.file.PathMatcher interface?
3.
Given:
public class DataCache {
private static final DataCache instance = new DataCache ();
public static DataCache getInstance () {
return instance;
}
}
Which design pattern best describes the class?
4.
Given the code format:
SimpleDateFormat sdf;
Which code statements will display the full text month name?
5.
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");
6.
Given the code fragment:
SimpleDateFormat sdf;
Which code fragment displays the two-digit month number?
7.
Which three enum constants are defined in FilevisitResult?
8.
Given the following code fragment:
public static void main(String[] args) {
Path tempFile = null;
try {
Path p = Paths.get("emp");
tempFile = Files.createTempFile(p, "report", ".tmp");
try (BufferedWriter writer = Files.newBufferedWriter(tempFile, Charset.forName("UTF8")))){ writer.write("Java SE 7");
}
System.out.println("Temporary file write done");
} catch(IOException e) {
System.err.println("Caught IOException: " + e.getMessage()); }
}
What is the result?
9.
Which two Capabilities does Java.util.concurcent.BlockingQueue provide to handle operation that cannot be handled immediately?
10.
Which is true regarding the java.nio.file.Path Interface?