1z0-809 Exam Question 81
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?
1z0-809 Exam Question 82
Given the code fragment:
List<String> nL = Arrays.asList("Jim", "John", "Jeff");
Function<String, String> funVal = s -> "Hello : ".contact(s);
nL.Stream()
.map(funVal)
.peek(System.out::print);
What is the result?
Hello : Jim Hello : John Hello : Jeff
List<String> nL = Arrays.asList("Jim", "John", "Jeff");
Function<String, String> funVal = s -> "Hello : ".contact(s);
nL.Stream()
.map(funVal)
.peek(System.out::print);
What is the result?
Hello : Jim Hello : John Hello : Jeff
1z0-809 Exam Question 83
Given the code fragments:

and

Which two modifications enable to sort the elements of the emps list? (Choose two.)

and

Which two modifications enable to sort the elements of the emps list? (Choose two.)
1z0-809 Exam Question 84
Given:
public class Customer {
private String fName;
private String lName;
private static int count;
public customer (String first, String last) {fName = first, lName = last;
+ +count;}
static { count = 0; }
public static int getCount() {return count; }
}
public class App {
public static void main (String [] args) {
Customer c1 = new Customer("Larry", "Smith");
Customer c2 = new Customer("Pedro", "Gonzales");
Customer c3 = new Customer("Penny", "Jones");
Customer c4 = new Customer("Lars", "Svenson");
c4 = null;
c3 = c2;
System.out.println (Customer.getCount());
}
}
What is the result?
public class Customer {
private String fName;
private String lName;
private static int count;
public customer (String first, String last) {fName = first, lName = last;
+ +count;}
static { count = 0; }
public static int getCount() {return count; }
}
public class App {
public static void main (String [] args) {
Customer c1 = new Customer("Larry", "Smith");
Customer c2 = new Customer("Pedro", "Gonzales");
Customer c3 = new Customer("Penny", "Jones");
Customer c4 = new Customer("Lars", "Svenson");
c4 = null;
c3 = c2;
System.out.println (Customer.getCount());
}
}
What is the result?
1z0-809 Exam Question 85
Given:

What is the result?

What is the result?