In this tutorial, we will see “what is mapToInt() operation as part of streams introduced in Java 8 with example?”

mapToInt() returns an IntStream consisting of the results of applying the given function to the elements of this stream. This is an intermediate operation. 

mapToInt_Streams_Signature_Java8_Techndeck

Stream mapToInt in Java 8 with example...!!! Click To Tweet

Example

 

Output:

Stream mapToInt in Java 8 with example...!!! Click To Tweet

Do you like this Post? – then check my other helpful posts:

Other Useful References: