Java developers have heard a lot about functional-style programming - particularly with Java 8's addition of lambda expressions.
"First-class functions in Java 8" is a 12 minute video tutorial from Java 8 in Action: Lambdas, Streams, and functional-style programming by Raoul-Gabriel Urma, Mario Fusco and Alan Mycroft.
This video introduces method references and lambda expressions, the mechanisms Java 8 provides to pass a behavior as an argument to a method.
To save 38% on this or any other Manning books, just enter vturma01 in the Promotional Code box when you check out at manning.com.
!{iframe width="560" height="315" src="//www.youtube.com/embed/gDTzlfjMe98" frameborder="0" allowfullscreen}{/iframe}
While the term "lambda expression" may sound abstract and academic, Java 8 Lambdas can have a big impact on how you program every day. In simplest terms, a lambda expression is a function—a bit of code—that you can pass to another method as an argument. Thus, you can cope with changing requirements by using a behavior, represented by a lambda, as a parameter. Java 8's functional programming features, like lambdas and the new Stream API that enables a cleaner way to iterate through collections, can help you write concise, maintainable code that scales easily and performs well on multicore architectures. Java 8 in Action is a clearly-written guide to Java 8 lambdas and functional programming in Java. It begins with a practical introduction to the structure and benefits of lambda expressions in real-world Java code. The book then introduces the Stream API and shows how it can make collections-related code radically easier to understand and maintain. Along the way, you'll discover new FP-oriented design patterns with Java 8 for code reuse, code readability, exception handling, data manipulation, and concurrency. For developers also exploring other functional languages on the JVM, the book concludes with a quick survey of useful functional features in Scala and Clojure.