CodeX
Published in

CodeX

It’s a Stream, not a River: Be careful with Java Streams

Disclaimer: All opinions are my own

Photo by Pixabay from Pexels

Java streams are a helpful feature with a lot of power behind them. They help you write significantly cleaner code and take you from.

ArrayList<Integer> amounts = new ArrayList<Integer>();
amounts.add(100);
amounts.add(200);
amounts.add(500);
amounts.add(1000);
amounts.add(2000);
amounts.add(5000);

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Brian Olson

Engineer, formerly at Amazon, currently at Google. All opinions are my own. Consider supporting here: https://devblabs.medium.com/membership