1z0-809 Exam Question 56
Given that data.txt and alldata.txt are accessible, and the code fragment:

What is required at line n1to enable the code to overwrite alldata.txtwith data.txt?

What is required at line n1to enable the code to overwrite alldata.txtwith data.txt?
1z0-809 Exam Question 57
Given the code fragment:
List<Integer> codes = Arrays.asList (10, 20);
UnaryOperator<Double> uo = s -> s +10.0;
codes.replaceAll(uo);
codes.forEach(c -> System.out.println(c));
What is the result?
List<Integer> codes = Arrays.asList (10, 20);
UnaryOperator<Double> uo = s -> s +10.0;
codes.replaceAll(uo);
codes.forEach(c -> System.out.println(c));
What is the result?
1z0-809 Exam Question 58
Given the content:

and the code fragment:

What is the result?

and the code fragment:

What is the result?
1z0-809 Exam Question 59
Given that these files exist and are accessible:

and given the code fragment:

Which code fragment can be inserted at line n1 to enable the code to print only /company/emp?

and given the code fragment:

Which code fragment can be inserted at line n1 to enable the code to print only /company/emp?
1z0-809 Exam Question 60
Given the code fragment:
public class FileThread implements Runnable {
String fName;
public FileThread(String fName) { this.fName = fName; }
public void run () System.out.println(fName);}
public static void main (String[] args) throws IOException,
InterruptedException {
ExecutorService executor = Executors.newCachedThreadPool();
Stream<Path> listOfFiles = Files.walk(Paths.get("Java Projects"));
listOfFiles.forEach(line -> {
executor.execute(new FileThread(line.getFileName().toString())); //
line n1
});
executor.shutdown();
executor.awaitTermination(5, TimeUnit.DAYS);//
line n2
}
}
The Java Projects directory exists and contains a list of files.
What is the result?
public class FileThread implements Runnable {
String fName;
public FileThread(String fName) { this.fName = fName; }
public void run () System.out.println(fName);}
public static void main (String[] args) throws IOException,
InterruptedException {
ExecutorService executor = Executors.newCachedThreadPool();
Stream<Path> listOfFiles = Files.walk(Paths.get("Java Projects"));
listOfFiles.forEach(line -> {
executor.execute(new FileThread(line.getFileName().toString())); //
line n1
});
executor.shutdown();
executor.awaitTermination(5, TimeUnit.DAYS);//
line n2
}
}
The Java Projects directory exists and contains a list of files.
What is the result?
