SlideShare a Scribd company logo
λ
Lambda Expressions in Java 8
functions as values
var square = function(x) { return x * x };
var apply = function(data, func) {
return func(data);
}
console.log(apply(10, square));
Ang Java ay parang
kami ng ex ko...

..wala paring closure.
- anon

Recommended for you

Millionways
MillionwaysMillionways
Millionways

Catamorphims and junk in js. F-algebras at the end are cool. No Fx type necessary for now, but still works with it.

functional programmingrecursionhaskell
Sixth session
Sixth sessionSixth session
Sixth session

Lists and tuples are the main data types used to store multiple values in Python. Lists are ordered and changeable, while tuples are ordered and unchangeable. Some key differences are that lists use brackets and allow indexing, slicing, changing values, and other mutable operations, while tuples use parentheses and do not support mutable operations since values cannot be changed. Both support functions like append, length, checking for membership, and looping through values.

python
The Ring programming language version 1.10 book - Part 30 of 212
The Ring programming language version 1.10 book - Part 30 of 212The Ring programming language version 1.10 book - Part 30 of 212
The Ring programming language version 1.10 book - Part 30 of 212

This document discusses lists in Ring programming language. It covers creating, accessing, modifying lists as well as common list operations like sorting, searching, reversing etc. Lists can contain other lists, allowing for nested data structures. Key points include: - Lists are created using square brackets or range operators. Items can be added or removed using functions like Add(), Del(). - The len() function returns the number of items in a list. Individual items can be accessed using their index in square brackets. - Common operations include sorting with sort(), reversing with reverse(), searching with find(). - Lists are passed by reference, so functions can modify the original list. They also support string indices to access items.

ringring programmingring programming language
Anonymous Inner Classes
Collections.sort(personList, new Comparator<Person>(){
public int compare(Person p1, Person p2){
return p1.firstName.compareTo(p2.firstName);
}
});
Anonymous Inner Classes
Collections.sort(personList, new Comparator<Person>(){
public int compare(Person p1, Person p2){
return p1.firstName.compareTo(p2.firstName);
}
});

Lambda Expressions
Collections.sort(personList, (Person p1, Person p2) ->
p1.firstName.compareTo(p2.firstName));
Lambda Expressions
Collections.sort(personList, (Person p1, Person p2) ->
p1.firstName.compareTo(p2.firstName));

Lambda Exp. (shorter)
Collections.sort(personList,
(p1, p2) -> p1.firstName.compareTo(p2.firstName));
JEP 107
Bulk Data Operations
for Collections
(e.g filter/map/reduce)

Recommended for you

The Ring programming language version 1.4 book - Part 6 of 30
The Ring programming language version 1.4 book - Part 6 of 30The Ring programming language version 1.4 book - Part 6 of 30
The Ring programming language version 1.4 book - Part 6 of 30

This document provides information about string, date, time, and mathematical functions in Ring programming language. It describes functions for string manipulation like substr(), strcmp(), str2list(), list2str(). It discusses date/time functions such as date(), time(), addDays(), diffDays(). It also covers data type checking, character checking, and conversion functions. Finally, it lists common mathematical functions in Ring like sin(), cos(), tan(), random(), sqrt().

ringring programmingring programming language
The Ring programming language version 1.6 book - Part 26 of 189
The Ring programming language version 1.6 book - Part 26 of 189The Ring programming language version 1.6 book - Part 26 of 189
The Ring programming language version 1.6 book - Part 26 of 189

This document provides documentation on mathematical functions available in the Ring programming language. It lists functions for trigonometric, hyperbolic, exponential, logarithmic, rounding and random number generation. Examples are given showing how to use functions like sin(), cos(), tan(), exp(), log(), ceil(), floor(), sqrt(), and random(). Conversions between radians and degrees are demonstrated for trigonometric functions.

ringring programmingring programming language
学生向けScalaハンズオンテキスト
学生向けScalaハンズオンテキスト学生向けScalaハンズオンテキスト
学生向けScalaハンズオンテキスト

This document provides an overview of the Scala programming language. It discusses Scala's JVM compatibility, basic data types like Int, Double, String, collections like List and Map, control flow structures like if/else and for loops, functions using def and =>, pattern matching, and common functions on collections like sum, length, and mean. It also shows examples of using Scala from the command line and with SBT.

scalaprogrammingintroduction
filter
List<Employee> old = new ArrayList<Employee>();
for (Employee e : employeeList) {
if (e.age() > 60) {
old.add(e);
}
}
filter
List<Employee> old = new ArrayList<Employee>();
for (Employee e : employeeList) {
if (e.age() > 60) {
old.add(e);
}
}

List<Employee> old = employeeList.stream()
.filter(e -> e.age() > 60)
.collect(
Collectors.toCollection(
() -> new ArrayList<>()
)
);
filter
List<Employee> old = new ArrayList<Employee>();
for (Employee e : employeeList) {
if (e.age() > 60) {
old.add(e);
}
}

List<Employee> old = employeeList.stream()
.filter(e -> e.age() > 60)
.collect(Collectors.toCollection(
() -> new ArrayList<>()));
filter
List<Employee> old = new ArrayList<Employee>();
for (Employee e : employeeList) {
if (e.age() > 60) {
old.add(e);
}
}

List<Employee> old = employeeList.stream()
.filter(e -> e.age() > 60)
.collect(
Collectors.toCollection(
ArrayList::new
)
);

Recommended for you

学生向けScalaハンズオンテキスト part2
学生向けScalaハンズオンテキスト part2学生向けScalaハンズオンテキスト part2
学生向けScalaハンズオンテキスト part2

学生向けScalaハンズオンテキスト part2 - パラメータ化された型 - 存在型 - 数値とモノイド - 多相と型クラス cf. part1: https://www.slideshare.net/opttechnologies/scala-handson-textbook-83475085

programmingscalaintroduction
Oh Composable World!
Oh Composable World!Oh Composable World!
Oh Composable World!

The document discusses functional programming concepts like pure functions, immutable data, and avoiding side effects. It compares imperative programming constructs like loops and mutable state to functional alternatives like map, filter, reduce. It argues that a functional style enables better reasoning about programs by avoiding side effects and complex control flow. Specific examples show transforming an imperative loop into a functional map and handling asynchronous code through chained promises or futures. Overall it advocates for a functional programming approach.

functional programmingobject-orientedmonad
ScalaMeter 2014
ScalaMeter 2014ScalaMeter 2014
ScalaMeter 2014

This document describes ScalaMeter, a performance regression testing framework. It discusses several problems that can occur when benchmarking code performance, including warmup effects from JIT compilation, interference from other processes, garbage collection triggering, and variability from other runtime events. It provides examples demonstrating these issues and discusses solutions like running benchmarks in a separate JVM, ignoring measurements impacted by garbage collection, and performing many repetitions to obtain a stable mean.

testingscalabenchmarking
filter
List<Employee> old = new ArrayList<Employee>();
for (Employee e : employeeList) {
if (e.age() > 60) {
old.add(e);
}
}

List<Employee> old = employeeList.stream()
.filter(e -> e.age() > 60)
.collect(Collectors.toCollection(ArrayList::new));
filter
List<Employee> old = new ArrayList<Employee>();
for (Employee e : employeeList) {
if (e.age() > 60) {
old.add(e);
}
}

List<Employee> old = employeeList.stream()
.filter(e -> e.age() > 60)
.collect(Collectors.toList());
map
List<String> names = new ArrayList<String>();
for (Employee e : employeeList) {
names.add(e.firstName() + " " + e.lastName());
}
map
List<String> names = new ArrayList<String>();
for (Employee e : employeeList) {
names.add(e.firstName() + " " + e.lastName());
}

List<String> names = employeeList.stream()
.map(e -> e.firstName() + " " + e.lastName())
.collect(Collectors.toList());

Recommended for you

Scala parallel-collections
Scala parallel-collectionsScala parallel-collections
Scala parallel-collections

Playing with the Parallel collections in Scala and evaluating in which scenarios we would possibly use them.

collectionsknolxknoldus
Drools5 Community Training Module 3 Drools Expert DRL Syntax
Drools5 Community Training Module 3 Drools Expert DRL SyntaxDrools5 Community Training Module 3 Drools Expert DRL Syntax
Drools5 Community Training Module 3 Drools Expert DRL Syntax

for more information visit: http://salaboy.wordpress.com/2011/02/23/drools-5-community-training-announced-roadmap/

examplesdroolsilesteban
Remoção em Lista Simplesmente Encadeada
Remoção em Lista Simplesmente EncadeadaRemoção em Lista Simplesmente Encadeada
Remoção em Lista Simplesmente Encadeada

The document describes functions for removing nodes from the beginning and end of a singly linked list. It includes pseudocode for a removeFromBeginning function that removes the first node by updating the next pointer of the head, and a removeFromEnd function that iterates through the list to find the second to last node and sets its next pointer to null to remove the last node. Diagrams are provided showing the steps and changes to pointers when calling each function.

removerlista encadeada
reduce
BigDecimal totalSalary = BigDecimal.ZERO;
for (Employee e : employeeList) {
totalTax = totalTax.add(e.salary());
}
reduce
BigDecimal totalSalary = BigDecimal.ZERO;
for (Employee e : employeeList) {
totalTax = totalTax.add(e.salary());
}

BigDecimal totalSalary = employeeList.stream()
.reduce(BigDecimal.ZERO,
(sum, e) -> sum.add(e.salary()),
(bd1, bd2) -> bd1.add(bd2));
reduce
BigDecimal totalSalary = BigDecimal.ZERO;
for (Employee e : employeeList) {
totalTax = totalTax.add(e.salary());
}

BigDecimal totalSalary = employeeList.stream()
.reduce(BigDecimal.ZERO,
(sum, e) -> sum.add(e.salary()),
BigDecimal::add);
chaining
BigDecimal totalOldTax = employeeList.stream()
.filter(e -> e.age() > 60)
.map(e -> e.salary().multiply(e.taxRate()))
.reduce(BigDecimal.ZERO,
(sum, tax) -> sum.add(tax);

Recommended for you

Kotlin Advanced - Apalon Kotlin Sprint Part 3
Kotlin Advanced - Apalon Kotlin Sprint Part 3Kotlin Advanced - Apalon Kotlin Sprint Part 3
Kotlin Advanced - Apalon Kotlin Sprint Part 3

The document discusses several Kotlin advanced topics including delegated properties, lazy properties, objects, higher-order functions, lambdas, inline functions, and standard library functions like apply, also, let. It explains concepts like lazy initialization with lazy properties, property delegation, object expressions and declarations, functional programming with higher-order functions and lambdas, and inline functions for performance. It also covers utility functions in the standard library for working with objects and collections.

kotlinjava
The Ring programming language version 1.5.1 book - Part 21 of 180
The Ring programming language version 1.5.1 book - Part 21 of 180The Ring programming language version 1.5.1 book - Part 21 of 180
The Ring programming language version 1.5.1 book - Part 21 of 180

The document discusses various methods for working with strings in Ring programming language. Some key points include: - Strings can be defined using double or single quotes, and the : operator can be used to define strings as literals. - The len() function returns the length of a string. Functions like lower(), upper() can convert case, and left(), right() extract substrings. - Individual characters in a string can be accessed and modified using indexes. The trim() function removes leading/trailing spaces. - The copy() function duplicates a string, and lines() counts lines in a string. - The substr() function allows finding, extracting, and replacing substrings. strcmp() compares two

ringring programmingring programming language
Poor Man's Functional Programming
Poor Man's Functional ProgrammingPoor Man's Functional Programming
Poor Man's Functional Programming

This document discusses ways to introduce functional programming concepts into Java code using existing Java 8 features, third-party libraries like Guava and LambdaJ, and by implementing common functional patterns and data structures yourself. It provides examples of using higher order functions, pure functions, recursion, and currying in Java code. It also summarizes capabilities of the Guava and LambdaJ libraries for functional programming in Java.

just like SQL
BigDecimal totalOldTax = employeeList.stream()
.filter(e -> e.age() > 60)
.map(e -> e.salary().multiply(e.taxRate()))
.reduce(BigDecimal.ZERO,
(sum, tax) -> sum.add(tax);

SELECT SUM(salary * tax_rate)
FROM employees
WHERE age > 60;
just like SQL
filter() => WHERE, GROUP BY
map()

=> SELECT, inline query

reduce() => aggregate functions
sort()

=> ORDER BY
λ
Java 8
Where to get Lambda
Project Page

http://openjdk.java.net/projects/lambda/

JDK8
http://jdk8.java.net/download.html

JDK8 w/ Lambda
http://jdk8.java.net/lambda/

NetBeans Nightly

http://bertram2.netbeans.org:8080/job/jdk8lambda/lastSuccessfulBuild/artifact/nbbuild/

Recommended for you

Drools5 Community Training HandsOn 1 Drools DRL Syntax
Drools5 Community Training HandsOn 1 Drools DRL SyntaxDrools5 Community Training HandsOn 1 Drools DRL Syntax
Drools5 Community Training HandsOn 1 Drools DRL Syntax

for more information visit: http://salaboy.wordpress.com/2011/02/23/drools-5-community-training-announced-roadmap/

examplesdroolsil esteban
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure

This document discusses refactoring Java code to Clojure using macros. It provides examples of refactoring Java code that uses method chaining to equivalent Clojure code using the threading macros (->> and -<>). It also discusses other Clojure features like type hints, the doto macro, and polyglot projects using Leiningen.

My first experience with lambda expressions in java
My first experience with lambda expressions in javaMy first experience with lambda expressions in java
My first experience with lambda expressions in java

This document discusses the author's first experience using lambda expressions in Java 8. It provides instructions on setting up Java 8 and examples of using lambda expressions for threads, collections, and mapping/reducing streams. Lambda expressions allow passing functionality as arguments to replace anonymous inner classes. The examples demonstrate using lambda expressions for runnables, foreach loops, and mapping/reducing operations. References for further reading on Java 8 lambdas are also included.

java 8 lambda
Thank you for listening!

bryanbibat.net | @bry_bibat
speakerdeck.com/bryanbibat

More Related Content

What's hot

Functional Patterns for the non-mathematician
Functional Patterns for the non-mathematicianFunctional Patterns for the non-mathematician
Functional Patterns for the non-mathematician
Brian Lonsdorf
 
Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)
Calvin Cheng
 
Linq introduction
Linq introductionLinq introduction
Linq introduction
Mohammad Alyan
 
Millionways
MillionwaysMillionways
Millionways
Brian Lonsdorf
 
Sixth session
Sixth sessionSixth session
Sixth session
AliMohammad155
 
The Ring programming language version 1.10 book - Part 30 of 212
The Ring programming language version 1.10 book - Part 30 of 212The Ring programming language version 1.10 book - Part 30 of 212
The Ring programming language version 1.10 book - Part 30 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.4 book - Part 6 of 30
The Ring programming language version 1.4 book - Part 6 of 30The Ring programming language version 1.4 book - Part 6 of 30
The Ring programming language version 1.4 book - Part 6 of 30
Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 26 of 189
The Ring programming language version 1.6 book - Part 26 of 189The Ring programming language version 1.6 book - Part 26 of 189
The Ring programming language version 1.6 book - Part 26 of 189
Mahmoud Samir Fayed
 
学生向けScalaハンズオンテキスト
学生向けScalaハンズオンテキスト学生向けScalaハンズオンテキスト
学生向けScalaハンズオンテキスト
Opt Technologies
 
学生向けScalaハンズオンテキスト part2
学生向けScalaハンズオンテキスト part2学生向けScalaハンズオンテキスト part2
学生向けScalaハンズオンテキスト part2
Opt Technologies
 
Oh Composable World!
Oh Composable World!Oh Composable World!
Oh Composable World!
Brian Lonsdorf
 
ScalaMeter 2014
ScalaMeter 2014ScalaMeter 2014
ScalaMeter 2014
Aleksandar Prokopec
 
Scala parallel-collections
Scala parallel-collectionsScala parallel-collections
Scala parallel-collections
Knoldus Inc.
 
Drools5 Community Training Module 3 Drools Expert DRL Syntax
Drools5 Community Training Module 3 Drools Expert DRL SyntaxDrools5 Community Training Module 3 Drools Expert DRL Syntax
Drools5 Community Training Module 3 Drools Expert DRL Syntax
Mauricio (Salaboy) Salatino
 
Remoção em Lista Simplesmente Encadeada
Remoção em Lista Simplesmente EncadeadaRemoção em Lista Simplesmente Encadeada
Remoção em Lista Simplesmente Encadeada
Elaine Cecília Gatto
 
Kotlin Advanced - Apalon Kotlin Sprint Part 3
Kotlin Advanced - Apalon Kotlin Sprint Part 3Kotlin Advanced - Apalon Kotlin Sprint Part 3
Kotlin Advanced - Apalon Kotlin Sprint Part 3
Kirill Rozov
 
The Ring programming language version 1.5.1 book - Part 21 of 180
The Ring programming language version 1.5.1 book - Part 21 of 180The Ring programming language version 1.5.1 book - Part 21 of 180
The Ring programming language version 1.5.1 book - Part 21 of 180
Mahmoud Samir Fayed
 
Poor Man's Functional Programming
Poor Man's Functional ProgrammingPoor Man's Functional Programming
Poor Man's Functional Programming
Dmitry Buzdin
 
Drools5 Community Training HandsOn 1 Drools DRL Syntax
Drools5 Community Training HandsOn 1 Drools DRL SyntaxDrools5 Community Training HandsOn 1 Drools DRL Syntax
Drools5 Community Training HandsOn 1 Drools DRL Syntax
Mauricio (Salaboy) Salatino
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 

What's hot (20)

Functional Patterns for the non-mathematician
Functional Patterns for the non-mathematicianFunctional Patterns for the non-mathematician
Functional Patterns for the non-mathematician
 
Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)
 
Linq introduction
Linq introductionLinq introduction
Linq introduction
 
Millionways
MillionwaysMillionways
Millionways
 
Sixth session
Sixth sessionSixth session
Sixth session
 
The Ring programming language version 1.10 book - Part 30 of 212
The Ring programming language version 1.10 book - Part 30 of 212The Ring programming language version 1.10 book - Part 30 of 212
The Ring programming language version 1.10 book - Part 30 of 212
 
The Ring programming language version 1.4 book - Part 6 of 30
The Ring programming language version 1.4 book - Part 6 of 30The Ring programming language version 1.4 book - Part 6 of 30
The Ring programming language version 1.4 book - Part 6 of 30
 
The Ring programming language version 1.6 book - Part 26 of 189
The Ring programming language version 1.6 book - Part 26 of 189The Ring programming language version 1.6 book - Part 26 of 189
The Ring programming language version 1.6 book - Part 26 of 189
 
学生向けScalaハンズオンテキスト
学生向けScalaハンズオンテキスト学生向けScalaハンズオンテキスト
学生向けScalaハンズオンテキスト
 
学生向けScalaハンズオンテキスト part2
学生向けScalaハンズオンテキスト part2学生向けScalaハンズオンテキスト part2
学生向けScalaハンズオンテキスト part2
 
Oh Composable World!
Oh Composable World!Oh Composable World!
Oh Composable World!
 
ScalaMeter 2014
ScalaMeter 2014ScalaMeter 2014
ScalaMeter 2014
 
Scala parallel-collections
Scala parallel-collectionsScala parallel-collections
Scala parallel-collections
 
Drools5 Community Training Module 3 Drools Expert DRL Syntax
Drools5 Community Training Module 3 Drools Expert DRL SyntaxDrools5 Community Training Module 3 Drools Expert DRL Syntax
Drools5 Community Training Module 3 Drools Expert DRL Syntax
 
Remoção em Lista Simplesmente Encadeada
Remoção em Lista Simplesmente EncadeadaRemoção em Lista Simplesmente Encadeada
Remoção em Lista Simplesmente Encadeada
 
Kotlin Advanced - Apalon Kotlin Sprint Part 3
Kotlin Advanced - Apalon Kotlin Sprint Part 3Kotlin Advanced - Apalon Kotlin Sprint Part 3
Kotlin Advanced - Apalon Kotlin Sprint Part 3
 
The Ring programming language version 1.5.1 book - Part 21 of 180
The Ring programming language version 1.5.1 book - Part 21 of 180The Ring programming language version 1.5.1 book - Part 21 of 180
The Ring programming language version 1.5.1 book - Part 21 of 180
 
Poor Man's Functional Programming
Poor Man's Functional ProgrammingPoor Man's Functional Programming
Poor Man's Functional Programming
 
Drools5 Community Training HandsOn 1 Drools DRL Syntax
Drools5 Community Training HandsOn 1 Drools DRL SyntaxDrools5 Community Training HandsOn 1 Drools DRL Syntax
Drools5 Community Training HandsOn 1 Drools DRL Syntax
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 

Viewers also liked

My first experience with lambda expressions in java
My first experience with lambda expressions in javaMy first experience with lambda expressions in java
My first experience with lambda expressions in java
Scheidt & Bachmann
 
Lambda expressions
Lambda expressionsLambda expressions
Lambda expressions
Doron Gold
 
Java Logging discussion Log4j,Slf4j
Java Logging discussion Log4j,Slf4jJava Logging discussion Log4j,Slf4j
Java Logging discussion Log4j,Slf4j
Rajiv Gupta
 
Lambda expressions
Lambda expressionsLambda expressions
Lambda expressions
Yuriy Seniuk
 
Simplifying java with lambdas (short)
Simplifying java with lambdas (short)Simplifying java with lambdas (short)
Simplifying java with lambdas (short)
RichardWarburton
 
OCP Java SE 8 Exam - Sample Questions - Lambda Expressions
OCP Java SE 8 Exam - Sample Questions - Lambda Expressions OCP Java SE 8 Exam - Sample Questions - Lambda Expressions
OCP Java SE 8 Exam - Sample Questions - Lambda Expressions
Ganesh Samarthyam
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8
icarter09
 
Fun with lambda expressions
Fun with lambda expressionsFun with lambda expressions
Fun with lambda expressions
Mike Melusky
 
Java 8 lambdas expressions
Java 8 lambdas expressionsJava 8 lambdas expressions
Java 8 lambdas expressions
Lars Lemos
 
Programming with Lambda Expressions in Java
Programming with Lambda Expressions in Java Programming with Lambda Expressions in Java
Programming with Lambda Expressions in Java
langer4711
 
SLF4J Explained........
SLF4J Explained........SLF4J Explained........
SLF4J Explained........
Sunitha Satyadas
 
Lambda: A Peek Under The Hood - Brian Goetz
Lambda: A Peek Under The Hood - Brian GoetzLambda: A Peek Under The Hood - Brian Goetz
Lambda: A Peek Under The Hood - Brian Goetz
JAX London
 
Lambda Expressions in Java
Lambda Expressions in JavaLambda Expressions in Java
Lambda Expressions in Java
Erhan Bagdemir
 
Reflection
ReflectionReflection
Lambda expressions
Lambda expressionsLambda expressions
Lambda expressions
Melick Baranasooriya
 
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and StreamsIntroduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Emiel Paasschens
 
Java 8 lambda
Java 8 lambdaJava 8 lambda
Java 8 lambda
Manav Prasad
 
Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...
Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...
Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...
Philip Schwarz
 
Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams
Ganesh Samarthyam
 
Java 8 Lambda Expressions & Streams
Java 8 Lambda Expressions & StreamsJava 8 Lambda Expressions & Streams
Java 8 Lambda Expressions & Streams
NewCircle Training
 

Viewers also liked (20)

My first experience with lambda expressions in java
My first experience with lambda expressions in javaMy first experience with lambda expressions in java
My first experience with lambda expressions in java
 
Lambda expressions
Lambda expressionsLambda expressions
Lambda expressions
 
Java Logging discussion Log4j,Slf4j
Java Logging discussion Log4j,Slf4jJava Logging discussion Log4j,Slf4j
Java Logging discussion Log4j,Slf4j
 
Lambda expressions
Lambda expressionsLambda expressions
Lambda expressions
 
Simplifying java with lambdas (short)
Simplifying java with lambdas (short)Simplifying java with lambdas (short)
Simplifying java with lambdas (short)
 
OCP Java SE 8 Exam - Sample Questions - Lambda Expressions
OCP Java SE 8 Exam - Sample Questions - Lambda Expressions OCP Java SE 8 Exam - Sample Questions - Lambda Expressions
OCP Java SE 8 Exam - Sample Questions - Lambda Expressions
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8
 
Fun with lambda expressions
Fun with lambda expressionsFun with lambda expressions
Fun with lambda expressions
 
Java 8 lambdas expressions
Java 8 lambdas expressionsJava 8 lambdas expressions
Java 8 lambdas expressions
 
Programming with Lambda Expressions in Java
Programming with Lambda Expressions in Java Programming with Lambda Expressions in Java
Programming with Lambda Expressions in Java
 
SLF4J Explained........
SLF4J Explained........SLF4J Explained........
SLF4J Explained........
 
Lambda: A Peek Under The Hood - Brian Goetz
Lambda: A Peek Under The Hood - Brian GoetzLambda: A Peek Under The Hood - Brian Goetz
Lambda: A Peek Under The Hood - Brian Goetz
 
Lambda Expressions in Java
Lambda Expressions in JavaLambda Expressions in Java
Lambda Expressions in Java
 
Reflection
ReflectionReflection
Reflection
 
Lambda expressions
Lambda expressionsLambda expressions
Lambda expressions
 
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and StreamsIntroduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
 
Java 8 lambda
Java 8 lambdaJava 8 lambda
Java 8 lambda
 
Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...
Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...
Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...
 
Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams
 
Java 8 Lambda Expressions & Streams
Java 8 Lambda Expressions & StreamsJava 8 Lambda Expressions & Streams
Java 8 Lambda Expressions & Streams
 

Similar to Lambda Expressions in Java 8

A bit about Scala
A bit about ScalaA bit about Scala
A bit about Scala
Vladimir Parfinenko
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
Hiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
Hiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
Hiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
Hiroshi Ono
 
Idiomatic Kotlin
Idiomatic KotlinIdiomatic Kotlin
Idiomatic Kotlin
intelliyole
 
Scala in a Java 8 World
Scala in a Java 8 WorldScala in a Java 8 World
Scala in a Java 8 World
Daniel Blyth
 
List out of lambda
List out of lambdaList out of lambda
List out of lambda
Vyatcheslav Potravnyy
 
Scala 2013 review
Scala 2013 reviewScala 2013 review
Scala 2013 review
Sagie Davidovich
 
07. Java Array, Set and Maps
07.  Java Array, Set and Maps07.  Java Array, Set and Maps
07. Java Array, Set and Maps
Intro C# Book
 
Rewriting Java In Scala
Rewriting Java In ScalaRewriting Java In Scala
Rewriting Java In Scala
Skills Matter
 
Kotlin collections
Kotlin collectionsKotlin collections
Kotlin collections
Myeongin Woo
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java Programmers
Tikal Knowledge
 
1.2 Scala Basics
1.2 Scala Basics1.2 Scala Basics
1.2 Scala Basics
retronym
 
Scala - THE language for Big Data
Scala - THE language for Big DataScala - THE language for Big Data
Scala - THE language for Big Data
Tzach Zohar
 
The Ring programming language version 1.7 book - Part 26 of 196
The Ring programming language version 1.7 book - Part 26 of 196The Ring programming language version 1.7 book - Part 26 of 196
The Ring programming language version 1.7 book - Part 26 of 196
Mahmoud Samir Fayed
 
iRODS Rule Language Cheat Sheet
iRODS Rule Language Cheat SheetiRODS Rule Language Cheat Sheet
iRODS Rule Language Cheat Sheet
Samuel Lampa
 
Python : Functions
Python : FunctionsPython : Functions
FUNctional Programming in Java 8
FUNctional Programming in Java 8FUNctional Programming in Java 8
FUNctional Programming in Java 8
Richard Walker
 
Java Generics
Java GenericsJava Generics
Java Generics
Zülfikar Karakaya
 

Similar to Lambda Expressions in Java 8 (20)

A bit about Scala
A bit about ScalaA bit about Scala
A bit about Scala
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
Idiomatic Kotlin
Idiomatic KotlinIdiomatic Kotlin
Idiomatic Kotlin
 
Scala in a Java 8 World
Scala in a Java 8 WorldScala in a Java 8 World
Scala in a Java 8 World
 
List out of lambda
List out of lambdaList out of lambda
List out of lambda
 
Scala 2013 review
Scala 2013 reviewScala 2013 review
Scala 2013 review
 
07. Java Array, Set and Maps
07.  Java Array, Set and Maps07.  Java Array, Set and Maps
07. Java Array, Set and Maps
 
Rewriting Java In Scala
Rewriting Java In ScalaRewriting Java In Scala
Rewriting Java In Scala
 
Kotlin collections
Kotlin collectionsKotlin collections
Kotlin collections
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java Programmers
 
1.2 Scala Basics
1.2 Scala Basics1.2 Scala Basics
1.2 Scala Basics
 
Scala - THE language for Big Data
Scala - THE language for Big DataScala - THE language for Big Data
Scala - THE language for Big Data
 
The Ring programming language version 1.7 book - Part 26 of 196
The Ring programming language version 1.7 book - Part 26 of 196The Ring programming language version 1.7 book - Part 26 of 196
The Ring programming language version 1.7 book - Part 26 of 196
 
iRODS Rule Language Cheat Sheet
iRODS Rule Language Cheat SheetiRODS Rule Language Cheat Sheet
iRODS Rule Language Cheat Sheet
 
Python : Functions
Python : FunctionsPython : Functions
Python : Functions
 
FUNctional Programming in Java 8
FUNctional Programming in Java 8FUNctional Programming in Java 8
FUNctional Programming in Java 8
 
Java Generics
Java GenericsJava Generics
Java Generics
 

More from bryanbibat

Hd 10 japan
Hd 10 japanHd 10 japan
Hd 10 japan
bryanbibat
 
Static Sites in Ruby
Static Sites in RubyStatic Sites in Ruby
Static Sites in Ruby
bryanbibat
 
So You Want to Teach Ruby and Rails...
So You Want to Teach Ruby and Rails...So You Want to Teach Ruby and Rails...
So You Want to Teach Ruby and Rails...
bryanbibat
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)
bryanbibat
 
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
bryanbibat
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginners
bryanbibat
 
Rails is Easy*
Rails is Easy*Rails is Easy*
Rails is Easy*
bryanbibat
 
Things Future IT Students Should Know (But Don't)
Things Future IT Students Should Know (But Don't)Things Future IT Students Should Know (But Don't)
Things Future IT Students Should Know (But Don't)
bryanbibat
 
Things IT Undergrads Should Know (But Don't)
Things IT Undergrads Should Know (But Don't)Things IT Undergrads Should Know (But Don't)
Things IT Undergrads Should Know (But Don't)
bryanbibat
 
From Novice to Expert: A Pragmatic Approach to Learning
From Novice to Expert: A Pragmatic Approach to LearningFrom Novice to Expert: A Pragmatic Approach to Learning
From Novice to Expert: A Pragmatic Approach to Learning
bryanbibat
 
Preparing for the WebGeek DevCup
Preparing for the WebGeek DevCupPreparing for the WebGeek DevCup
Preparing for the WebGeek DevCup
bryanbibat
 
Productive text editing with Vim
Productive text editing with VimProductive text editing with Vim
Productive text editing with Vim
bryanbibat
 
Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)
bryanbibat
 
Latest Trends in Web Technologies
Latest Trends in Web TechnologiesLatest Trends in Web Technologies
Latest Trends in Web Technologies
bryanbibat
 
Virtualization
VirtualizationVirtualization
Virtualization
bryanbibat
 
Some Myths in Software Development
Some Myths in Software DevelopmentSome Myths in Software Development
Some Myths in Software Development
bryanbibat
 
Latest Trends in Open Source Web Technologies
Latest Trends in Open Source Web TechnologiesLatest Trends in Open Source Web Technologies
Latest Trends in Open Source Web Technologies
bryanbibat
 
What it takes to be a Web Developer
What it takes to be a Web DeveloperWhat it takes to be a Web Developer
What it takes to be a Web Developer
bryanbibat
 
Ruby and Rails by example
Ruby and Rails by exampleRuby and Rails by example
Ruby and Rails by example
bryanbibat
 
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails
bryanbibat
 

More from bryanbibat (20)

Hd 10 japan
Hd 10 japanHd 10 japan
Hd 10 japan
 
Static Sites in Ruby
Static Sites in RubyStatic Sites in Ruby
Static Sites in Ruby
 
So You Want to Teach Ruby and Rails...
So You Want to Teach Ruby and Rails...So You Want to Teach Ruby and Rails...
So You Want to Teach Ruby and Rails...
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)
 
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginners
 
Rails is Easy*
Rails is Easy*Rails is Easy*
Rails is Easy*
 
Things Future IT Students Should Know (But Don't)
Things Future IT Students Should Know (But Don't)Things Future IT Students Should Know (But Don't)
Things Future IT Students Should Know (But Don't)
 
Things IT Undergrads Should Know (But Don't)
Things IT Undergrads Should Know (But Don't)Things IT Undergrads Should Know (But Don't)
Things IT Undergrads Should Know (But Don't)
 
From Novice to Expert: A Pragmatic Approach to Learning
From Novice to Expert: A Pragmatic Approach to LearningFrom Novice to Expert: A Pragmatic Approach to Learning
From Novice to Expert: A Pragmatic Approach to Learning
 
Preparing for the WebGeek DevCup
Preparing for the WebGeek DevCupPreparing for the WebGeek DevCup
Preparing for the WebGeek DevCup
 
Productive text editing with Vim
Productive text editing with VimProductive text editing with Vim
Productive text editing with Vim
 
Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)
 
Latest Trends in Web Technologies
Latest Trends in Web TechnologiesLatest Trends in Web Technologies
Latest Trends in Web Technologies
 
Virtualization
VirtualizationVirtualization
Virtualization
 
Some Myths in Software Development
Some Myths in Software DevelopmentSome Myths in Software Development
Some Myths in Software Development
 
Latest Trends in Open Source Web Technologies
Latest Trends in Open Source Web TechnologiesLatest Trends in Open Source Web Technologies
Latest Trends in Open Source Web Technologies
 
What it takes to be a Web Developer
What it takes to be a Web DeveloperWhat it takes to be a Web Developer
What it takes to be a Web Developer
 
Ruby and Rails by example
Ruby and Rails by exampleRuby and Rails by example
Ruby and Rails by example
 
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails
 

Recently uploaded

Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
Matthew Sinclair
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
Lidia A.
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Bert Blevins
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
UiPathCommunity
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
Bert Blevins
 

Recently uploaded (20)

Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
 

Lambda Expressions in Java 8

  • 1. λ
  • 3. functions as values var square = function(x) { return x * x }; var apply = function(data, func) { return func(data); } console.log(apply(10, square));
  • 4. Ang Java ay parang kami ng ex ko... ..wala paring closure. - anon
  • 5. Anonymous Inner Classes Collections.sort(personList, new Comparator<Person>(){ public int compare(Person p1, Person p2){ return p1.firstName.compareTo(p2.firstName); } });
  • 6. Anonymous Inner Classes Collections.sort(personList, new Comparator<Person>(){ public int compare(Person p1, Person p2){ return p1.firstName.compareTo(p2.firstName); } }); Lambda Expressions Collections.sort(personList, (Person p1, Person p2) -> p1.firstName.compareTo(p2.firstName));
  • 7. Lambda Expressions Collections.sort(personList, (Person p1, Person p2) -> p1.firstName.compareTo(p2.firstName)); Lambda Exp. (shorter) Collections.sort(personList, (p1, p2) -> p1.firstName.compareTo(p2.firstName));
  • 8. JEP 107 Bulk Data Operations for Collections (e.g filter/map/reduce)
  • 9. filter List<Employee> old = new ArrayList<Employee>(); for (Employee e : employeeList) { if (e.age() > 60) { old.add(e); } }
  • 10. filter List<Employee> old = new ArrayList<Employee>(); for (Employee e : employeeList) { if (e.age() > 60) { old.add(e); } } List<Employee> old = employeeList.stream() .filter(e -> e.age() > 60) .collect( Collectors.toCollection( () -> new ArrayList<>() ) );
  • 11. filter List<Employee> old = new ArrayList<Employee>(); for (Employee e : employeeList) { if (e.age() > 60) { old.add(e); } } List<Employee> old = employeeList.stream() .filter(e -> e.age() > 60) .collect(Collectors.toCollection( () -> new ArrayList<>()));
  • 12. filter List<Employee> old = new ArrayList<Employee>(); for (Employee e : employeeList) { if (e.age() > 60) { old.add(e); } } List<Employee> old = employeeList.stream() .filter(e -> e.age() > 60) .collect( Collectors.toCollection( ArrayList::new ) );
  • 13. filter List<Employee> old = new ArrayList<Employee>(); for (Employee e : employeeList) { if (e.age() > 60) { old.add(e); } } List<Employee> old = employeeList.stream() .filter(e -> e.age() > 60) .collect(Collectors.toCollection(ArrayList::new));
  • 14. filter List<Employee> old = new ArrayList<Employee>(); for (Employee e : employeeList) { if (e.age() > 60) { old.add(e); } } List<Employee> old = employeeList.stream() .filter(e -> e.age() > 60) .collect(Collectors.toList());
  • 15. map List<String> names = new ArrayList<String>(); for (Employee e : employeeList) { names.add(e.firstName() + " " + e.lastName()); }
  • 16. map List<String> names = new ArrayList<String>(); for (Employee e : employeeList) { names.add(e.firstName() + " " + e.lastName()); } List<String> names = employeeList.stream() .map(e -> e.firstName() + " " + e.lastName()) .collect(Collectors.toList());
  • 17. reduce BigDecimal totalSalary = BigDecimal.ZERO; for (Employee e : employeeList) { totalTax = totalTax.add(e.salary()); }
  • 18. reduce BigDecimal totalSalary = BigDecimal.ZERO; for (Employee e : employeeList) { totalTax = totalTax.add(e.salary()); } BigDecimal totalSalary = employeeList.stream() .reduce(BigDecimal.ZERO, (sum, e) -> sum.add(e.salary()), (bd1, bd2) -> bd1.add(bd2));
  • 19. reduce BigDecimal totalSalary = BigDecimal.ZERO; for (Employee e : employeeList) { totalTax = totalTax.add(e.salary()); } BigDecimal totalSalary = employeeList.stream() .reduce(BigDecimal.ZERO, (sum, e) -> sum.add(e.salary()), BigDecimal::add);
  • 20. chaining BigDecimal totalOldTax = employeeList.stream() .filter(e -> e.age() > 60) .map(e -> e.salary().multiply(e.taxRate())) .reduce(BigDecimal.ZERO, (sum, tax) -> sum.add(tax);
  • 21. just like SQL BigDecimal totalOldTax = employeeList.stream() .filter(e -> e.age() > 60) .map(e -> e.salary().multiply(e.taxRate())) .reduce(BigDecimal.ZERO, (sum, tax) -> sum.add(tax); SELECT SUM(salary * tax_rate) FROM employees WHERE age > 60;
  • 22. just like SQL filter() => WHERE, GROUP BY map() => SELECT, inline query reduce() => aggregate functions sort() => ORDER BY
  • 24. Where to get Lambda Project Page http://openjdk.java.net/projects/lambda/ JDK8 http://jdk8.java.net/download.html JDK8 w/ Lambda http://jdk8.java.net/lambda/ NetBeans Nightly http://bertram2.netbeans.org:8080/job/jdk8lambda/lastSuccessfulBuild/artifact/nbbuild/
  • 25. Thank you for listening! bryanbibat.net | @bry_bibat speakerdeck.com/bryanbibat