1Z0-809 practice question 13 of 25

Given the definition of the Emp class: public class Emp private String eName; private Integer eAge; Emp(String eN, Integer eA) { this.eName = eN…

Choose your answer, then check it against the explanation.

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: Listli = Arrays.asList(new Emp(“Sam”, 20), New Emp(“John”, 60), New Emp(“Jim”, 51)); Predicate agVal = s -> s.getEAge() > 50;//line n1 li = li.stream().filter(agVal).collect(Collectors.toList()); Stream names = li.stream()map.(Emp::getEName);//line n2 names.forEach(n -> System.out.print(n + “ “)); What is the result?
Answer options
Question 13 of 25

Keep practicing

Take the free 1Z0-809 practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other 1Z0-809 practice questions

Scroll to Top