Solved

Complete the Following Code Snippet That Returns a Stream of Student

Question 57

Multiple Choice

Complete the following code snippet that returns a stream of Student objects, representing students who have a grade point average (gpa) of at least 3.8.Assume that studentStream is a stream of Student objects and the getGpa method returns a double representing the student's gpa.
Stream<Student> highHonors = studentStream
________________________________;


A) .map(getGpa() >= 3.8)
B) .filter(getGpa() >= 3.8)
C) .map(s -> s.getGpa() >= 3.8)
D) .filter(s -> s.getGpa() >= 3.8)

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions