Given the code fragment:
Stream<Path> files = Files.walk(Paths.get(System.getProperty("user.home"))); files.forEach (fName -> { //line n1
try {
Path aPath = fName.toAbsolutePath(); //line n2
System.out.println(fName + ":"
+ Files.readAttributes(aPath,
Basic.File.Attributes.class).creationTime
( ));
} catch (IOException ex) {
ex.printStackTrace();
});
What is the result?
Which two statements are true about localizing an application?
Given:
public class Emp {
String fName;
String lName;
public Emp (String fn, String ln) {
fName = fn;
lName = ln;
}
public String getfName() { return fName; }
public String getlName() { return lName; }
}
and the code fragment:
List<Emp> emp = Arrays.asList (
new Emp ("John", "Smith"),
new Emp ("Peter", "Sam"),
new Emp ("Thomas", "Wale"));
emp.stream()
/ /line n1
. collect(Collectors.toList());
Which code fragment, when inserted at line n1, sorts the employees list in descending order of fNameand then ascending order of lName?