Question 130 of 130 from exam 1Z0-809: Java SE 8 Programmer II

Question 130 of 130 from exam 1Z0-809: Java SE 8 Programmer II

Question

Given:

class Person {

private String firstName;

private int salary;

public Person(String £N, int sal) {
this.firstName = £N;
this.salary = sal;

}

public int getSalary() { return salary; }

public String getFirstName() { return firstName;
List<Person> prog = Arrays.asbist (
new Person("Smith", 1500),
new Person("John", 2000),
new Person("Joe", 1000));
double dval = prog.stream()
-filter(s -> s.getFirstName().startsWith("J"))
-mapToInt (Person: :getSalary)
-average ()
-getAsDouble ()
System. out.print (dval);

What is the result?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B.