Java Streams | MapToInt & Sum Example | Tech Primers

preview_player
Показать описание
This video covers the mapToInt and sum functions in Java Streams API

Video Editing: iMovie

Рекомендации по теме
Комментарии
Автор

Hi, thanks for this video. A small clarification. You say (minute 02:56) that map didn't have any terminal operations. But, as far as I can see, map has terminal operations, like for example count. I guess it can't have sum just because with map you can map from a generic type T to a generic type S, and it's not guaranteed that the sum operation is defined in the domain of T objects; while, if you use mapToInt (and similar) you have this operation for sure.

vpezzano
Автор

Thanks. Simple and to he point explanation.

nehajain
Автор

Hi, Nice video.. How can we use RegEx with Map? I have a list of string with Pattern. I would like to do a exact match for a word in that list of string and return true if so. I tried as below. Please suggest if there is a better way.

 strList.stream().map(s -> regexMatcher(regex,

GiriAlkondanSubbiah
welcome to shbcf.ru