Solved

Which Statement Creates a List from a Stream of Student

Question 43

Multiple Choice

Which statement creates a list from a stream of Student objects, given by the variable studentStream?


A) List<Student> students = studentStream.collect(Collectors.toList() ) ;
B) List<Student> students = studentStream.toList(Student::new) ;
C) List<Student> students = studentStream.collect(Student[]::new) ;
D) List<Student> students = studentStream.toList() ;

Correct Answer:

verifed

Verified

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

Related Questions