1z0-809 Exam Question 21
Given the code fragment:

Which code fragment, when inserted at line n1, enables the code to print /First.txt?

Which code fragment, when inserted at line n1, enables the code to print /First.txt?
1z0-809 Exam Question 22
Given the Greetings.propertiesfile, containing:

and given:

What is the result?

and given:

What is the result?
1z0-809 Exam Question 23
Given the code fragment:
List<String> str = Arrays.asList ("my", "pen", "is", "your', "pen"); Predicate<String> test = s -> {
int i = 0;
boolean result = s.contains ("pen");
System.out.print(i++) + ":");
return result;
};
str.stream()
.filter(test)
.findFirst()
.ifPresent(System.out ::print);
What is the result?
List<String> str = Arrays.asList ("my", "pen", "is", "your', "pen"); Predicate<String> test = s -> {
int i = 0;
boolean result = s.contains ("pen");
System.out.print(i++) + ":");
return result;
};
str.stream()
.filter(test)
.findFirst()
.ifPresent(System.out ::print);
What is the result?
1z0-809 Exam Question 24
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 25
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?
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?