Question 121
Given the code fragment:
What is the result?
Question 122
Given the records from the STUDENT table:
Given the code fragment:
Assume that the URL, username, and password are valid.
What is the result?
Question 123
Given the code fragment:
Path source = Paths.get ("/data/december/log.txt");
Path destination = Paths.get("/data");
Files.copy (source, destination);
and assuming that the file /data/december/log.txtis accessible and contains:
10-Dec-2014 - Executed successfully
What is the result?
Question 124
Given the code fragment:
public void recDelete (String dirName) throws IOException {
File [ ] listOfFiles = new File (dirName) .listFiles();
if (listOfFiles ! = null && listOfFiles.length >0) {
for (File aFile : listOfFiles) {
if (aFile.isDirectory ()) {
recDelete (aFile.getAbsolutePath ());
} else { if (aFile.getName ().endsWith (".class")) aFile.delete (); } } } }
Assume that Projects contains subdirectories that contain .class files and is passed as an argument to the recDelete () method when it is invoked.
What is the result?
Question 125
Given:
final class Folder { //line n1
/ /line n2
public void open () {
System.out.print("Open");
}
}
public class Test {
public static void main (String [] args) throws Exception {
try (Folder f = new Folder()) {
f.open();
}
}
}
Which two modifications enable the code to print Open Close?
