Question 47 of 76 from exam 1Z0-808: Java SE 8 Programmer I

Question 47 of 76 from exam 1Z0-808: Java SE 8 Programmer I

Question

Given the code fragments:

Person. java

public class Person {
String name;
int age;

public Person(string n, int a) {
name =n;
age = a;

}

public string getName () {
return name;
}

public int getage(Q {
return age;
}
3

Test.java

public static void checkage(List<Person> list, Predicate<Person> predicate) {
for (Person p: list) {
if (predicate.test (p)) {
System.out.println(p.name +" ");

)

public static void main(string[] args) {
List<Person> iList = Arrays.asList (new Pergon("Hank", 45),
new Person("Charlie", 40),
new Person("Smith", 38));
ffline nl

Which code fragment, when inserted at line n1, enables the code to print Hank?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C.