Java 11 new features | Collections API enhancements | Java Beam

preview_player
Показать описание
This video explains about the java 11 new features related to collections API toArray method
Рекомендации по теме
Комментарии
Автор

Sir, your tutorials are very, very comprehensive and useful. Also, your mic setup in this video is perfect. Keep on uploading more and more videos: shorts as well as nice long tutorials and playlists.

ytrishirajxtrim
Автор

Hi, I have just installed JDK17 from Oracle. Older eclipse installation stopped working, so I installed the latest (2021-09-R 2021 Sep 14) eclipse for Java EE to work with JDK17.

Now, I'm getting the error for arr = list.toArray(size -> new Integer[size]):
The method toArray(T[]) in the type ArrayList<Integer> is not applicable for the arguments ((int size) -> {})
The target type of this expression must be a functional interface

Please guide me to resolve this.

rishiraj
Автор

How does the toArray(IntFunction) know the array size?
You say toArray( size -> new Integer[size]) in the lambda expression.
What is the value passed into "size"?

HenryLeu
Автор

please make proper videos else dont make

ayushjain