Link Details

Link 1151555 thumbnail
User 301357 avatar

By Zeeshan Bilal
Submitted: May 08 2014 / 23:45

Ever since I heard Java 8 is going to support lambda expressions (aka closures), I was very enthusiastic to spice my code with such a decent and concise functional element. Most developers extensively use Anonymous Inner Classes for event handlers, comparators, basic thread/runnable implementations, etc and overburden the logic with unnecessary scaffoldings even a very simple piece of code seems complex and unwieldy. Java 8 now added Lambda expressions as part of language syntax that help solve similar problem in a very elegant manner. It enable developers to encapsulate a single unit of behavior and pass it to other code. It’s like syntactic sugar for an anonymous class (with one method whose type is inferred) and is an object-less method. I prefer avoiding extensive theoretical material in this post, but before moving further towards understanding the syntax, structure and examples of lambdas, there is an important concept need attention.
  • 2
  • 0
  • 101
  • 212

Add your comment

Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (2)

Voters Against This Link (0)

    Java Performance Optimization
    Written by: Pierre-Hugues Charbonneau
    Featured Refcardz: Top Refcardz:
    1. Design Patterns
    2. OO JS
    3. Cont. Delivery
    4. Java EE7
    5. HTML5 Mobile
    1. Node.js
    2. Debugging JavaScript
    3. OO JS
    4. JSON
    5. Ajax