Which statement is true about the single abstract method of the java.util.function.Function interface?
Correct Answer:
D
Given the definition of the Country class: public class country {
public enum Continent {ASIA, EUROPE} String name;
Continent region;
public Country (String na, Continent reg) { name = na, region = reg;
}
public String getName () {return name;} public Continent getRegion () {return region;}
}
and the code fragment:
List
new Country (“Japan”, Country.Continent.ASIA), new Country (“Italy”, Country.Continent.EUROPE),
new Country (“Germany”, Country.Continent.EUROPE)); Map
.c ollect(Collectors.groupingBy (Country ::getRegion, Collectors.mapping(Country::getName, Collectors.toList())))); System.out.println(regionNames);
Correct Answer:
B
Given the code fragment:
Assume that:
The required database driver is configured in the classpath.
The appropriate database is accessible with the dbURL, userName, and passWord exists The Employee table has a column ID of type integer and the SQL query matches one record. What is the result?
Correct Answer:
A
Given:
and the code fragment:
Which definition of the ColorSorter class sorts the blocks list?
Correct Answer:
B
Given the code fragment:
Path source = Paths.get (“/data/december/log.txt”); Path destination = Paths.get(“/data”);
Files.copy (source, destination);
and assuming that the file /data/december/log.txt is accessible and contains: 10-Dec-2014 – Executed successfully
What is the result?
Correct Answer:
D