SlideShare a Scribd company logo
1 of 31
Download to read offline
Lambda, Method References & 
Aggregate Operations 
Md. Fasihul Kabir 
Software Engineer, Platform Dhaka, Escenic Asia Ltd.
Some Cool Features of Java 8 
 Lambda expressions 
 Method references 
 Default Methods (Defender methods) 
 A new Stream API 
 Optional 
 A new Date/Time API 
 Nashorn, the new JavaScript engine 
 Removal of the Permanent Generation 
 and more…
Some Cool Features of Java 8 
 Lambda Expressions 
 Method References 
 Default Methods (Defender methods) 
 A new Stream API 
 Optional 
 A new Date/Time API 
 Nashorn, the new JavaScript engine 
 Removal of the Permanent Generation 
 and more…
Lambda Expressions
Syntax 
(arguments) - {body}
Example 
button.addActionListener(new ActionListener(){ 
public void actionPerformed(ActionEvent event){ 
System.out.println(button clicked); 
} 
});
button.addActionListener(new ActionListener(){ 
public void actionPerformed(ActionEvent event){ 
System.out.println(button clicked); 
} 
});
button.addActionListener( 
event - System.out.println(button clicked) 
);
Structure of Lambda Expressions 
 A lambda expression can have zero, one or more parameters 
 The type of the parameters can be explicitly declared or it can be inferred from the 
context. 
e.g. (int a) is same as just (a) 
 Parameters are enclosed in parentheses and separated by commas. 
e.g. (a, b) or (int a, int b) or (String a, int b, float c) 
 Empty parentheses are used to represent an empty set of parameters. 
e.g. () - 42 
 When there is a single parameter, if its type is inferred, it is not mandatory to use 
parentheses 
e.g. a - return a*a 
 The body of the lambda expressions can contain zero, one or more statements 
 If body of lambda expression has single statement curly brackets are not mandatory and 
the return type of the anonymous function is the same as that of the body expression 
 When there is more than one statement in body than these must be enclosed in curly 
brackets (a code block) and the return type of the anonymous function is the same as 
the type of the value returned within the code block, or void if nothing is returned
Method References
Kinds of Method References 
Kind Example 
Reference to a static method ContainingClass::staticMethodName 
Reference to an instance method of a 
particular object 
containingObject::instanceMethodName 
Reference to an instance method of an 
arbitrary object of a particular type 
ContainingType::methodName 
Reference to a constructor ClassName::new
Reference to a Static Method 
 The method reference Person::compareByAge is a 
reference to a static method.
Reference to an Instance Method of a 
Particular Object
Reference to an Instance Method of an 
Arbitrary Object of a Particular Type
Reference to a Constructor
Aggregate Operations
Pipelines and Streams
Components of Pipeline 
 A source: This could be a collection, an array, a 
generator function, or an I/O channel. In this example, 
the source is the collection roster. 
 Zero or more intermediate operations. An intermediate 
operation, such as filter, produces a new stream. 
 A terminal operation. A terminal operation, such as 
forEach, produces a non-stream result, such as a 
primitive value (like a double value), a collection, or in 
the case of forEach, no value at all.
Java 8
Java 8
Java 8

More Related Content

What's hot

Lambda expression par Christophe Huntzinger
Lambda expression par Christophe HuntzingerLambda expression par Christophe Huntzinger
Lambda expression par Christophe HuntzingerMik_Arber
 
Java in mule part 3
Java in mule part 3Java in mule part 3
Java in mule part 3vasanthii9
 
Module 13 operators, delegates, and events
Module 13 operators, delegates, and eventsModule 13 operators, delegates, and events
Module 13 operators, delegates, and eventsPrem Kumar Badri
 
Lambda/Streams Hands-On Lab
Lambda/Streams Hands-On LabLambda/Streams Hands-On Lab
Lambda/Streams Hands-On LabMaurice Naftalin
 
Scope demystified - AngularJS
Scope demystified - AngularJSScope demystified - AngularJS
Scope demystified - AngularJSSumanth krishna
 
Resharper - Next Steps
Resharper - Next StepsResharper - Next Steps
Resharper - Next StepsTimmy Kokke
 
GraphQL Misconfiguration
GraphQL MisconfigurationGraphQL Misconfiguration
GraphQL MisconfigurationHarshit Sengar
 
Java 8 presentation
Java 8 presentationJava 8 presentation
Java 8 presentationVan Huong
 
Introduction to Java 8
Introduction to Java 8Introduction to Java 8
Introduction to Java 8Knoldus Inc.
 
java 8 new features
java 8 new features java 8 new features
java 8 new features Rohit Verma
 
Scala Code Analysis at Codacy
Scala Code Analysis at CodacyScala Code Analysis at Codacy
Scala Code Analysis at CodacyJohann Oikonomou
 
Java 8 Lambda Expressions & Streams
Java 8 Lambda Expressions & StreamsJava 8 Lambda Expressions & Streams
Java 8 Lambda Expressions & StreamsNewCircle Training
 
2CPP08 - Overloading and Overriding
2CPP08 - Overloading and Overriding2CPP08 - Overloading and Overriding
2CPP08 - Overloading and OverridingMichael Heron
 
Применение паттерна Page Object для автоматизации веб сервисов
Применение паттерна Page Object для автоматизации веб сервисовПрименение паттерна Page Object для автоматизации веб сервисов
Применение паттерна Page Object для автоматизации веб сервисовCOMAQA.BY
 

What's hot (20)

Lambda expression par Christophe Huntzinger
Lambda expression par Christophe HuntzingerLambda expression par Christophe Huntzinger
Lambda expression par Christophe Huntzinger
 
Mule java part-3
Mule java part-3Mule java part-3
Mule java part-3
 
Java in mule part 3
Java in mule part 3Java in mule part 3
Java in mule part 3
 
Module 13 operators, delegates, and events
Module 13 operators, delegates, and eventsModule 13 operators, delegates, and events
Module 13 operators, delegates, and events
 
Understanding linq
Understanding linqUnderstanding linq
Understanding linq
 
Lambda/Streams Hands-On Lab
Lambda/Streams Hands-On LabLambda/Streams Hands-On Lab
Lambda/Streams Hands-On Lab
 
Scope demystified - AngularJS
Scope demystified - AngularJSScope demystified - AngularJS
Scope demystified - AngularJS
 
Resharper - Next Steps
Resharper - Next StepsResharper - Next Steps
Resharper - Next Steps
 
GraphQL Misconfiguration
GraphQL MisconfigurationGraphQL Misconfiguration
GraphQL Misconfiguration
 
Java 8 lambda
Java 8 lambdaJava 8 lambda
Java 8 lambda
 
Java 8 presentation
Java 8 presentationJava 8 presentation
Java 8 presentation
 
Attacking GraphQL
Attacking GraphQLAttacking GraphQL
Attacking GraphQL
 
Introduction to Java 8
Introduction to Java 8Introduction to Java 8
Introduction to Java 8
 
java 8 new features
java 8 new features java 8 new features
java 8 new features
 
Scala Code Analysis at Codacy
Scala Code Analysis at CodacyScala Code Analysis at Codacy
Scala Code Analysis at Codacy
 
Java 8 Lambda Expressions & Streams
Java 8 Lambda Expressions & StreamsJava 8 Lambda Expressions & Streams
Java 8 Lambda Expressions & Streams
 
Mule java part-3
Mule java part-3Mule java part-3
Mule java part-3
 
2CPP08 - Overloading and Overriding
2CPP08 - Overloading and Overriding2CPP08 - Overloading and Overriding
2CPP08 - Overloading and Overriding
 
Java8
Java8Java8
Java8
 
Применение паттерна Page Object для автоматизации веб сервисов
Применение паттерна Page Object для автоматизации веб сервисовПрименение паттерна Page Object для автоматизации веб сервисов
Применение паттерна Page Object для автоматизации веб сервисов
 

Viewers also liked

Tina Turner La Regina del Rock and Roll
Tina Turner La Regina del Rock and RollTina Turner La Regina del Rock and Roll
Tina Turner La Regina del Rock and Rollrockandrollboxmay21
 
Grafixoft ltd
Grafixoft ltdGrafixoft ltd
Grafixoft ltdGrafixoft
 
Andreas Ocklenburg, Cloudsme AG, DE
Andreas Ocklenburg, Cloudsme AG, DEAndreas Ocklenburg, Cloudsme AG, DE
Andreas Ocklenburg, Cloudsme AG, DEI4MS_eu
 
Introduction about GIT
Introduction about GITIntroduction about GIT
Introduction about GITmentallog
 
Grafixoft solutions
Grafixoft solutionsGrafixoft solutions
Grafixoft solutionsGrafixoft
 
Evaluation Feedback
Evaluation Feedback Evaluation Feedback
Evaluation Feedback mnatasha1
 
AGENSI PBB
AGENSI PBBAGENSI PBB
AGENSI PBBFad Deen
 
Prezentare Asociatia Tineretul ONU din Romania - Filiala Banat
Prezentare Asociatia Tineretul ONU din Romania - Filiala BanatPrezentare Asociatia Tineretul ONU din Romania - Filiala Banat
Prezentare Asociatia Tineretul ONU din Romania - Filiala BanatUNYouthBanatBranch
 
Indian Jugaad Technology (Frugal Engineering)
Indian Jugaad Technology (Frugal Engineering)Indian Jugaad Technology (Frugal Engineering)
Indian Jugaad Technology (Frugal Engineering)Javed Rizvi
 
Collective Communications in MPI
 Collective Communications in MPI Collective Communications in MPI
Collective Communications in MPIHanif Durad
 
Break out game
Break out gameBreak out game
Break out gamementallog
 
Gnito Deck
Gnito DeckGnito Deck
Gnito DeckGnito
 
Façade pattern
Façade patternFaçade pattern
Façade patternmentallog
 

Viewers also liked (20)

Tina Turner La Regina del Rock and Roll
Tina Turner La Regina del Rock and RollTina Turner La Regina del Rock and Roll
Tina Turner La Regina del Rock and Roll
 
Grafixoft ltd
Grafixoft ltdGrafixoft ltd
Grafixoft ltd
 
Andreas Ocklenburg, Cloudsme AG, DE
Andreas Ocklenburg, Cloudsme AG, DEAndreas Ocklenburg, Cloudsme AG, DE
Andreas Ocklenburg, Cloudsme AG, DE
 
Introduction about GIT
Introduction about GITIntroduction about GIT
Introduction about GIT
 
Grafixoft solutions
Grafixoft solutionsGrafixoft solutions
Grafixoft solutions
 
Infark
InfarkInfark
Infark
 
Evaluation Feedback
Evaluation Feedback Evaluation Feedback
Evaluation Feedback
 
Social work
Social workSocial work
Social work
 
Webaula 1
Webaula 1Webaula 1
Webaula 1
 
AGENSI PBB
AGENSI PBBAGENSI PBB
AGENSI PBB
 
Chapter 5 pc
Chapter 5 pcChapter 5 pc
Chapter 5 pc
 
Chapter 4 pc
Chapter 4 pcChapter 4 pc
Chapter 4 pc
 
Prezentare Asociatia Tineretul ONU din Romania - Filiala Banat
Prezentare Asociatia Tineretul ONU din Romania - Filiala BanatPrezentare Asociatia Tineretul ONU din Romania - Filiala Banat
Prezentare Asociatia Tineretul ONU din Romania - Filiala Banat
 
Indian Jugaad Technology (Frugal Engineering)
Indian Jugaad Technology (Frugal Engineering)Indian Jugaad Technology (Frugal Engineering)
Indian Jugaad Technology (Frugal Engineering)
 
Collective Communications in MPI
 Collective Communications in MPI Collective Communications in MPI
Collective Communications in MPI
 
Chapter 2 pc
Chapter 2 pcChapter 2 pc
Chapter 2 pc
 
Break out game
Break out gameBreak out game
Break out game
 
Gnito Deck
Gnito DeckGnito Deck
Gnito Deck
 
Façade pattern
Façade patternFaçade pattern
Façade pattern
 
Establishing Rapport
 Establishing Rapport    Establishing Rapport
Establishing Rapport
 

Similar to Java 8

java150929145120-lva1-app6892 (2).pptx
java150929145120-lva1-app6892 (2).pptxjava150929145120-lva1-app6892 (2).pptx
java150929145120-lva1-app6892 (2).pptxBruceLee275640
 
C0 review core java1
C0 review core java1C0 review core java1
C0 review core java1tam53pm1
 
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...vekariyakashyap
 
What's new in java 8
What's new in java 8What's new in java 8
What's new in java 8Dian Aditya
 
Ap Power Point Chpt4
Ap Power Point Chpt4Ap Power Point Chpt4
Ap Power Point Chpt4dplunkett
 
Chap-2 Classes & Methods.pptx
Chap-2 Classes & Methods.pptxChap-2 Classes & Methods.pptx
Chap-2 Classes & Methods.pptxchetanpatilcp783
 
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 StreamsEmiel Paasschens
 
Java8: Language Enhancements
Java8: Language EnhancementsJava8: Language Enhancements
Java8: Language EnhancementsYuriy Bondaruk
 
Java8 training - Class 1
Java8 training  - Class 1Java8 training  - Class 1
Java8 training - Class 1Marut Singh
 
Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신Sungchul Park
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1Todor Kolev
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1Todor Kolev
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1Todor Kolev
 
Functional Vaadin talk at OSCON 2014
Functional Vaadin talk at OSCON 2014Functional Vaadin talk at OSCON 2014
Functional Vaadin talk at OSCON 2014hezamu
 
Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...
Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...
Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...Edureka!
 
Abap Inicio
Abap InicioAbap Inicio
Abap Iniciounifor
 

Similar to Java 8 (20)

Java 8 Lambda Expressions
Java 8 Lambda ExpressionsJava 8 Lambda Expressions
Java 8 Lambda Expressions
 
java150929145120-lva1-app6892 (2).pptx
java150929145120-lva1-app6892 (2).pptxjava150929145120-lva1-app6892 (2).pptx
java150929145120-lva1-app6892 (2).pptx
 
C0 review core java1
C0 review core java1C0 review core java1
C0 review core java1
 
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
 
What's new in java 8
What's new in java 8What's new in java 8
What's new in java 8
 
Ap Power Point Chpt4
Ap Power Point Chpt4Ap Power Point Chpt4
Ap Power Point Chpt4
 
Chap-2 Classes & Methods.pptx
Chap-2 Classes & Methods.pptxChap-2 Classes & Methods.pptx
Chap-2 Classes & Methods.pptx
 
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
 
Java8: Language Enhancements
Java8: Language EnhancementsJava8: Language Enhancements
Java8: Language Enhancements
 
Java8 training - Class 1
Java8 training  - Class 1Java8 training  - Class 1
Java8 training - Class 1
 
Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신
 
Slides
SlidesSlides
Slides
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1
 
Functional Vaadin talk at OSCON 2014
Functional Vaadin talk at OSCON 2014Functional Vaadin talk at OSCON 2014
Functional Vaadin talk at OSCON 2014
 
Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...
Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...
Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...
 
Colloquium Report
Colloquium ReportColloquium Report
Colloquium Report
 
Java 8 Intro - Core Features
Java 8 Intro - Core FeaturesJava 8 Intro - Core Features
Java 8 Intro - Core Features
 
Abap Inicio
Abap InicioAbap Inicio
Abap Inicio
 

Recently uploaded

Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 

Recently uploaded (20)

Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 

Java 8

  • 1. Lambda, Method References & Aggregate Operations Md. Fasihul Kabir Software Engineer, Platform Dhaka, Escenic Asia Ltd.
  • 2. Some Cool Features of Java 8 Lambda expressions Method references Default Methods (Defender methods) A new Stream API Optional A new Date/Time API Nashorn, the new JavaScript engine Removal of the Permanent Generation and more…
  • 3. Some Cool Features of Java 8 Lambda Expressions Method References Default Methods (Defender methods) A new Stream API Optional A new Date/Time API Nashorn, the new JavaScript engine Removal of the Permanent Generation and more…
  • 6. Example button.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent event){ System.out.println(button clicked); } });
  • 7. button.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent event){ System.out.println(button clicked); } });
  • 8. button.addActionListener( event - System.out.println(button clicked) );
  • 9. Structure of Lambda Expressions A lambda expression can have zero, one or more parameters The type of the parameters can be explicitly declared or it can be inferred from the context. e.g. (int a) is same as just (a) Parameters are enclosed in parentheses and separated by commas. e.g. (a, b) or (int a, int b) or (String a, int b, float c) Empty parentheses are used to represent an empty set of parameters. e.g. () - 42 When there is a single parameter, if its type is inferred, it is not mandatory to use parentheses e.g. a - return a*a The body of the lambda expressions can contain zero, one or more statements If body of lambda expression has single statement curly brackets are not mandatory and the return type of the anonymous function is the same as that of the body expression When there is more than one statement in body than these must be enclosed in curly brackets (a code block) and the return type of the anonymous function is the same as the type of the value returned within the code block, or void if nothing is returned
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. Kinds of Method References Kind Example Reference to a static method ContainingClass::staticMethodName Reference to an instance method of a particular object containingObject::instanceMethodName Reference to an instance method of an arbitrary object of a particular type ContainingType::methodName Reference to a constructor ClassName::new
  • 17. Reference to a Static Method The method reference Person::compareByAge is a reference to a static method.
  • 18. Reference to an Instance Method of a Particular Object
  • 19. Reference to an Instance Method of an Arbitrary Object of a Particular Type
  • 20. Reference to a Constructor
  • 21.
  • 22.
  • 24.
  • 25.
  • 26.
  • 28. Components of Pipeline A source: This could be a collection, an array, a generator function, or an I/O channel. In this example, the source is the collection roster. Zero or more intermediate operations. An intermediate operation, such as filter, produces a new stream. A terminal operation. A terminal operation, such as forEach, produces a non-stream result, such as a primitive value (like a double value), a collection, or in the case of forEach, no value at all.