How knows Stream.toArray(Book[]::new); how many elements the array has and where is the implementation of “Book[]::new”
问题 I'm triying to understand method references and I don't know how with this "Book[]::new" it can create an array with the right number of elements. Book[] arrayBook = stBooks.toArray(Book[]::new); In order to create the array when I use the second and third option I have to specify a Functional Interface that Receive an Int and return a new Array. But, in the first option I don't know where is the implementation and where you specify the number or elements that is going to have the array. I