1z0-809 Exam Question 31

Given the definition of the Emp class:
public class Emp
private String eName;
private Integer eAge;
Emp(String eN, Integer eA) {
this.eName = eN;
this.eAge = eA;
}
public Integer getEAge () {return eAge;}
public String getEName () {return eName;}
}
and code fragment:
List<Emp>li = Arrays.asList(new Emp("Sam", 20), New Emp("John", 60), New Emp("Jim",
51));
Predicate<Emp> agVal = s -> s.getEAge() > 50;//line n1
li = li.stream().filter(agVal).collect(Collectors.toList());
Stream<String> names = li.stream()map.(Emp::getEName);//line n2
names.forEach(n -> System.out.print(n + " "));
What is the result?
  • 1z0-809 Exam Question 32

    Given the code fragment:

    What is the result?
  • 1z0-809 Exam Question 33

    Given the following array:

    Which two code fragments, independently, print each element in this array?
  • 1z0-809 Exam Question 34

    Given:

    What is the result?
  • 1z0-809 Exam Question 35

    Which two items can legally be contained within a java class declaration?