1z0-809 Exam Question 166
Given the code fragment:
List<String> listVal = Arrays.asList("Joe", "Paul", "Alice", "Tom");
System.out.println (
// line n1
);
Which code fragment, when inserted at line n1, enables the code to print the count of string elements whose length is greater than three?
List<String> listVal = Arrays.asList("Joe", "Paul", "Alice", "Tom");
System.out.println (
// line n1
);
Which code fragment, when inserted at line n1, enables the code to print the count of string elements whose length is greater than three?
1z0-809 Exam Question 167
Given the code fragment:

What is the result?

What is the result?
1z0-809 Exam Question 168
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 Projectscontains subdirectories that contain .classfiles 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 Projectscontains subdirectories that contain .classfiles and is passed as an argument to the recDelete ()method when it is invoked.
What is the result?
1z0-809 Exam Question 169
Given the code fragment:
BiFunction<Integer, Double, Integer> val = (t1, t2) -> t1 + t2; //line n1
//line n2
System.out.println(val.apply(10, 10.5));
What is the result?
BiFunction<Integer, Double, Integer> val = (t1, t2) -> t1 + t2; //line n1
//line n2
System.out.println(val.apply(10, 10.5));
What is the result?
1z0-809 Exam Question 170
Given the code fragment:
List<String> nL = Arrays.asList("Jim", "John", "Jeff");
Function<String, String> funVal = s -> "Hello : ".concat(s);
nL.Stream()
.map(funVal)
.forEach(s-> System.out.print (s));
What is the result?
List<String> nL = Arrays.asList("Jim", "John", "Jeff");
Function<String, String> funVal = s -> "Hello : ".concat(s);
nL.Stream()
.map(funVal)
.forEach(s-> System.out.print (s));
What is the result?