top of page

Java 8 stream hidden features

  • Writer: Anand Nerurkar
    Anand Nerurkar
  • Apr 25, 2024
  • 1 min read

we can make use of

Stream.ofNullable - return the same result as above


2.stream.iterate()- create infinite stream, creating certain pattern like 0,2,4,6,8.......

This create infinite stream



To break this infinite stream, we need to add termination, so we make use of limit as below


Collectors.collectingAndThen

to perform addtional transformation on collectors.

for ex: avg salary of employee


stream.takeWhile, stream.dropWhile




Collectors.teeing()

allows you to collect 2 collectors parallel and combine the result.



Collectors.partioningBy

allows you to partition a stream by certain condition


 
 
 

Recent Posts

See All
📘 Chapter 14:

Future of BFSI – AI-First, Composable Banking 1. The Shift Has Already Begun Banking is no longer just about: Accounts Transactions Branches It is becoming: Intelligent Real-time Platform-driven Embed

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
  • Facebook
  • Twitter
  • LinkedIn

©2026 by AeeroTech. Proudly created with Wix.com

bottom of page