<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Lambdas on Java &amp; Software Architecture Knowledge Hub</title><link>https://samirsahoo.github.io/design-patterns-hub/tags/lambdas/</link><description>Recent content in Lambdas on Java &amp; Software Architecture Knowledge Hub</description><generator>Hugo</generator><language>en-US</language><copyright>© 2026 Samir Kumar Sahoo (https://github.com/samirsahoo). All rights reserved.</copyright><atom:link href="https://samirsahoo.github.io/design-patterns-hub/tags/lambdas/index.xml" rel="self" type="application/rss+xml"/><item><title>Functional Programming in Java: Lambdas, Method References and Streams</title><link>https://samirsahoo.github.io/design-patterns-hub/java/advanced/functional-programming-and-streams/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/java/advanced/functional-programming-and-streams/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;Functional programming in Java&lt;/strong&gt; means passing &lt;strong&gt;behaviour as values&lt;/strong&gt;:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;lambdas&lt;/strong&gt; and &lt;strong&gt;method references&lt;/strong&gt; implement &lt;strong&gt;functional interfaces&lt;/strong&gt; (interfaces with one abstract method)&lt;/li&gt;&#10;&lt;li&gt;the &lt;strong&gt;Streams API&lt;/strong&gt; processes data declaratively: you say &lt;strong&gt;what&lt;/strong&gt; to compute (filter, map, group), not &lt;strong&gt;how&lt;/strong&gt; to loop.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="the-problem"&gt;The problem&lt;a class="heading-anchor" href="#the-problem" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Loops mix the &amp;ldquo;what&amp;rdquo; with the &amp;ldquo;how&amp;rdquo;: index variables, temporary collections and mutable accumulators. Anonymous inner classes for callbacks were verbose. Lambdas and streams make data transformations shorter and clearer, and easier to parallelise &lt;strong&gt;when&lt;/strong&gt; that helps.&lt;/p&gt;</description></item></channel></rss>