Solved

Which Statement Creates an Array from a Stream of Student

Question 35

Multiple Choice

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


A) Student[] students = studentStream.collect(Collectors.toArray() ) ;
B) Student[] students = studentStream.toArray(Student[]::new) ;
C) Student[] students = studentStream.toArray(new Student[]) ;
D) Student[] students = studentStream.toArray(new::Student[]) ;

Correct Answer:

verifed

Verified

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

Related Questions