SlideShare a Scribd company logo
1 of 22
Java 8
New Features
Significant Improvements
New features in the language
Aggregate operations
Compact profiles
Date-time package
HotSpot
Other Improvement (Not Covered Here)
Collections
Security
JavaFX
Tools
Internationalization
Scripting
IO and NIO
● java.lang and
java.util
● Networking
● Concurrency
New Features in The Language
lambda functions
method references
default methods
static methods (in interfaces)
Lambda Expressions
Lambda expressions are applicable only to
functional interfaces.
“A functional interface is any interface that
contains only one abstract method.”
“You can consider lambda expressions as
anonymous methods - methods without a
name.”
Lambdas. Suitable Places
Variable declarations
Assignments
Return statements
Array initializers
Method or constructor arguments
Lambda expression bodies
Conditional expressions, ?:
Cast expressions
Currying in Java 8?
In Scala we can do this:
object.curry(x)(y);
Can we do the same in Java 8?
Method References
“Compact, easy-to-read lambda expressions for
methods that already have a name”
Default Method
Nice construct.
Extremely suitable for enhancing existing
interfaces in libraries.
Default Method. Options for
Implementing class
Not mention the default method at all, which
lets your extended interface inherit the
default method.
Redeclare the default method, which makes it
abstract.
Redefine the default method, which overrides
it.
Static Method. Definition
“A static method is a method that is associated
with the class in which it is defined rather than
with any object. Every instance of the class
shares its static methods.” - Oracle
Useful to keep interface-related method in…
the interface itself!
Aggregate Operations
Stream is a sequence of elements supporting
sequential and parallel aggregate operations.
A pipeline is a sequence of aggregate
operations.
Pipeline parts
public void doStream(List<String> list) {
list.stream()
.filter(s -> s.length() > 5)
.forEach(s -> System.out.println(s));
}
Source
Intermediate operations (optional)
Terminal operation
Aggregations vs Iterators
Aggregation Iterators
Internal iteration External iteration
Parallel iteration Sequential iteration
Works with stream Works with collection
Accept lambda parameters -
Parallel Streams
public void doStream(List<String> list) {
list.stream()
.filter(s -> s.length() > 5)
.forEach(s -> System.out.println(s));
}
public void doStream(List<String> list) {
list.parallelStream()
.filter(s -> s.length() > 5)
.forEach(s -> System.out.println(s));
}
Parallel Stream Pitfalls
Single ForkJoinPool is used by default.
Do not use stateful lambdas.
Source of the stream may never be modified
in pipeline.
Use with extreme care in container
environment (e.g. in EE).
Date-Time API. Principles
clear
fluent
immutable
extensible
Date-Time Classes overview
DayOfWeem and Month enums
Dates: LocalDate, YearMonth, MonthDay, Year
Date & Time: LocalTime, LocalDateTime
Time zones: ZoneId, ZoneOffset,
ZonedDateTime, OffsetDateTime, OffsetTime
Instant
Period and Duration
Compact Profiles. Summary
The problem - the size of JRE is huge and
growing.
Target - modularization of JRE.
Work started as Project Jigsaw.
Java 8 brings compact profiles.
Full modularization planned for Java 9.
HotSpot
PermGen removed
AES is done on (capable) CPU
Supports default methods
Metaspace Highlights
Reduced amount of class metadata
Limited by amount of native memory (by
default)
Per-class loader spaces
Improved full collection time
Huge improvement potential in Java 9 :)
AES on CPU
Enabled by default
-XX:+UseAES -XX:+UseAESIntrinsics
-XX:-UseAES -XX:-UseAESIntrinsics
Works only on some Intel CPU’s
(manufactured in 2010 or later)
Does no work on AMD CPU’s

More Related Content

What's hot

Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8icarter09
 
Your First Scala Web Application using Play 2.1
Your First Scala Web Application using Play 2.1Your First Scala Web Application using Play 2.1
Your First Scala Web Application using Play 2.1Matthew Barlocker
 
Xml Publisher And Reporting To Excel
Xml Publisher And Reporting To ExcelXml Publisher And Reporting To Excel
Xml Publisher And Reporting To ExcelDuncan Davies
 
Memphis php 01 22-13 - laravel basics
Memphis php 01 22-13 - laravel basicsMemphis php 01 22-13 - laravel basics
Memphis php 01 22-13 - laravel basicsJoe Ferguson
 
Request-Response Cycle of Ruby on Rails App
Request-Response Cycle of Ruby on Rails AppRequest-Response Cycle of Ruby on Rails App
Request-Response Cycle of Ruby on Rails AppNathalie Steinmetz
 
Java features. Java 8, 9, 10, 11
Java features. Java 8, 9, 10, 11Java features. Java 8, 9, 10, 11
Java features. Java 8, 9, 10, 11Ivelin Yanev
 
9780538745840 ppt ch01 PHP
9780538745840 ppt ch01 PHP9780538745840 ppt ch01 PHP
9780538745840 ppt ch01 PHPTerry Yoast
 
Programming in Spark - Lessons Learned in OpenAire project
Programming in Spark - Lessons Learned in OpenAire projectProgramming in Spark - Lessons Learned in OpenAire project
Programming in Spark - Lessons Learned in OpenAire projectŁukasz Dumiszewski
 
Reactive Thinking in Java
Reactive Thinking in JavaReactive Thinking in Java
Reactive Thinking in JavaYakov Fain
 
java8-patterns
java8-patternsjava8-patterns
java8-patternsJustin Lin
 
9780538745840 ppt ch02
9780538745840 ppt ch029780538745840 ppt ch02
9780538745840 ppt ch02Terry Yoast
 
React and Flux life cycle with JSX, React Router and Jest Unit Testing
React and  Flux life cycle with JSX, React Router and Jest Unit TestingReact and  Flux life cycle with JSX, React Router and Jest Unit Testing
React and Flux life cycle with JSX, React Router and Jest Unit TestingEswara Kumar Palakollu
 
Extending Oracle E-Business Suite with Ruby on Rails
Extending Oracle E-Business Suite with Ruby on RailsExtending Oracle E-Business Suite with Ruby on Rails
Extending Oracle E-Business Suite with Ruby on RailsRaimonds Simanovskis
 
Flink Forward Berlin 2017: Maciek Próchniak - TouK Nussknacker - creating Fli...
Flink Forward Berlin 2017: Maciek Próchniak - TouK Nussknacker - creating Fli...Flink Forward Berlin 2017: Maciek Próchniak - TouK Nussknacker - creating Fli...
Flink Forward Berlin 2017: Maciek Próchniak - TouK Nussknacker - creating Fli...Flink Forward
 
Http programming in play
Http programming in playHttp programming in play
Http programming in playKnoldus Inc.
 
Ruby on Rails Kickstart 103 & 104
Ruby on Rails Kickstart 103 & 104Ruby on Rails Kickstart 103 & 104
Ruby on Rails Kickstart 103 & 104Heng-Yi Wu
 
Introduction to SoapUI day 3
Introduction to SoapUI day 3Introduction to SoapUI day 3
Introduction to SoapUI day 3Qualitest
 
Testing with Rspec 3
Testing with Rspec 3Testing with Rspec 3
Testing with Rspec 3David Paluy
 

What's hot (20)

Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8
 
Your First Scala Web Application using Play 2.1
Your First Scala Web Application using Play 2.1Your First Scala Web Application using Play 2.1
Your First Scala Web Application using Play 2.1
 
Xml Publisher And Reporting To Excel
Xml Publisher And Reporting To ExcelXml Publisher And Reporting To Excel
Xml Publisher And Reporting To Excel
 
Memphis php 01 22-13 - laravel basics
Memphis php 01 22-13 - laravel basicsMemphis php 01 22-13 - laravel basics
Memphis php 01 22-13 - laravel basics
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
 
Request-Response Cycle of Ruby on Rails App
Request-Response Cycle of Ruby on Rails AppRequest-Response Cycle of Ruby on Rails App
Request-Response Cycle of Ruby on Rails App
 
Java features. Java 8, 9, 10, 11
Java features. Java 8, 9, 10, 11Java features. Java 8, 9, 10, 11
Java features. Java 8, 9, 10, 11
 
9780538745840 ppt ch01 PHP
9780538745840 ppt ch01 PHP9780538745840 ppt ch01 PHP
9780538745840 ppt ch01 PHP
 
Programming in Spark - Lessons Learned in OpenAire project
Programming in Spark - Lessons Learned in OpenAire projectProgramming in Spark - Lessons Learned in OpenAire project
Programming in Spark - Lessons Learned in OpenAire project
 
Reactive Thinking in Java
Reactive Thinking in JavaReactive Thinking in Java
Reactive Thinking in Java
 
java8-patterns
java8-patternsjava8-patterns
java8-patterns
 
9780538745840 ppt ch02
9780538745840 ppt ch029780538745840 ppt ch02
9780538745840 ppt ch02
 
React and Flux life cycle with JSX, React Router and Jest Unit Testing
React and  Flux life cycle with JSX, React Router and Jest Unit TestingReact and  Flux life cycle with JSX, React Router and Jest Unit Testing
React and Flux life cycle with JSX, React Router and Jest Unit Testing
 
Extending Oracle E-Business Suite with Ruby on Rails
Extending Oracle E-Business Suite with Ruby on RailsExtending Oracle E-Business Suite with Ruby on Rails
Extending Oracle E-Business Suite with Ruby on Rails
 
Flink Forward Berlin 2017: Maciek Próchniak - TouK Nussknacker - creating Fli...
Flink Forward Berlin 2017: Maciek Próchniak - TouK Nussknacker - creating Fli...Flink Forward Berlin 2017: Maciek Próchniak - TouK Nussknacker - creating Fli...
Flink Forward Berlin 2017: Maciek Próchniak - TouK Nussknacker - creating Fli...
 
JavaCro'14 - Unit testing in AngularJS – Slaven Tomac
JavaCro'14 - Unit testing in AngularJS – Slaven TomacJavaCro'14 - Unit testing in AngularJS – Slaven Tomac
JavaCro'14 - Unit testing in AngularJS – Slaven Tomac
 
Http programming in play
Http programming in playHttp programming in play
Http programming in play
 
Ruby on Rails Kickstart 103 & 104
Ruby on Rails Kickstart 103 & 104Ruby on Rails Kickstart 103 & 104
Ruby on Rails Kickstart 103 & 104
 
Introduction to SoapUI day 3
Introduction to SoapUI day 3Introduction to SoapUI day 3
Introduction to SoapUI day 3
 
Testing with Rspec 3
Testing with Rspec 3Testing with Rspec 3
Testing with Rspec 3
 

Viewers also liked

Báo cáo tiểu luận hệ thống tên miền dns - học viện bưu chính viễn thông
Báo cáo tiểu luận   hệ thống tên miền dns - học viện bưu chính viễn thôngBáo cáo tiểu luận   hệ thống tên miền dns - học viện bưu chính viễn thông
Báo cáo tiểu luận hệ thống tên miền dns - học viện bưu chính viễn thônghttps://www.facebook.com/garmentspace
 
Bảo mật dữ liệu
Bảo mật dữ liệuBảo mật dữ liệu
Bảo mật dữ liệuSon Nguyen
 
Tieu luan nhom 3 slide
Tieu luan nhom 3   slideTieu luan nhom 3   slide
Tieu luan nhom 3 slidelaptrung
 
Slide bai giang_an_toan_va_bao_mat_thong_tin
Slide bai giang_an_toan_va_bao_mat_thong_tinSlide bai giang_an_toan_va_bao_mat_thong_tin
Slide bai giang_an_toan_va_bao_mat_thong_tinLang Codon
 
Bai 20-Mạng máy tính
Bai 20-Mạng máy tínhBai 20-Mạng máy tính
Bai 20-Mạng máy tínhbatup1989
 

Viewers also liked (6)

Báo cáo tiểu luận hệ thống tên miền dns - học viện bưu chính viễn thông
Báo cáo tiểu luận   hệ thống tên miền dns - học viện bưu chính viễn thôngBáo cáo tiểu luận   hệ thống tên miền dns - học viện bưu chính viễn thông
Báo cáo tiểu luận hệ thống tên miền dns - học viện bưu chính viễn thông
 
Bảo mật dữ liệu
Bảo mật dữ liệuBảo mật dữ liệu
Bảo mật dữ liệu
 
Tieu luan nhom 3 slide
Tieu luan nhom 3   slideTieu luan nhom 3   slide
Tieu luan nhom 3 slide
 
Bai thao giang
Bai thao giangBai thao giang
Bai thao giang
 
Slide bai giang_an_toan_va_bao_mat_thong_tin
Slide bai giang_an_toan_va_bao_mat_thong_tinSlide bai giang_an_toan_va_bao_mat_thong_tin
Slide bai giang_an_toan_va_bao_mat_thong_tin
 
Bai 20-Mạng máy tính
Bai 20-Mạng máy tínhBai 20-Mạng máy tính
Bai 20-Mạng máy tính
 

Similar to Java 8 New features

What's new in java 8
What's new in java 8What's new in java 8
What's new in java 8Dian Aditya
 
Java 8 lambdas expressions
Java 8 lambdas expressionsJava 8 lambdas expressions
Java 8 lambdas expressionsLars Lemos
 
Java 8 presentation
Java 8 presentationJava 8 presentation
Java 8 presentationVan Huong
 
New Features in JDK 8
New Features in JDK 8New Features in JDK 8
New Features in JDK 8Martin Toshev
 
What's new in Java 8
What's new in Java 8What's new in Java 8
What's new in Java 8Kyle Smith
 
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time APIModern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time APIGanesh Samarthyam
 
Automatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to InterfacesAutomatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to InterfacesRaffi Khatchadourian
 
New features in jdk8 iti
New features in jdk8 itiNew features in jdk8 iti
New features in jdk8 itiAhmed mar3y
 
Functional programming in java 8 by harmeet singh
Functional programming in java 8 by harmeet singhFunctional programming in java 8 by harmeet singh
Functional programming in java 8 by harmeet singhHarmeet Singh(Taara)
 
SOLID mit Java 8
SOLID mit Java 8SOLID mit Java 8
SOLID mit Java 8Roland Mast
 
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
 
Charles Sharp: Java 8 Streams
Charles Sharp: Java 8 StreamsCharles Sharp: Java 8 Streams
Charles Sharp: Java 8 Streamsjessitron
 

Similar to Java 8 New features (20)

Colloquium Report
Colloquium ReportColloquium Report
Colloquium Report
 
What's new in java 8
What's new in java 8What's new in java 8
What's new in java 8
 
Java 8 lambdas expressions
Java 8 lambdas expressionsJava 8 lambdas expressions
Java 8 lambdas expressions
 
Java 8 presentation
Java 8 presentationJava 8 presentation
Java 8 presentation
 
Lambdas in Java 8
Lambdas in Java 8Lambdas in Java 8
Lambdas in Java 8
 
New Features in JDK 8
New Features in JDK 8New Features in JDK 8
New Features in JDK 8
 
Java 8 Intro - Core Features
Java 8 Intro - Core FeaturesJava 8 Intro - Core Features
Java 8 Intro - Core Features
 
Java 8
Java 8Java 8
Java 8
 
What's new in Java 8
What's new in Java 8What's new in Java 8
What's new in Java 8
 
Java8
Java8Java8
Java8
 
Java 8
Java 8Java 8
Java 8
 
14274730 (1).ppt
14274730 (1).ppt14274730 (1).ppt
14274730 (1).ppt
 
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time APIModern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
 
Automatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to InterfacesAutomatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to Interfaces
 
New features in jdk8 iti
New features in jdk8 itiNew features in jdk8 iti
New features in jdk8 iti
 
Functional programming in java 8 by harmeet singh
Functional programming in java 8 by harmeet singhFunctional programming in java 8 by harmeet singh
Functional programming in java 8 by harmeet singh
 
SOLID mit Java 8
SOLID mit Java 8SOLID mit Java 8
SOLID mit Java 8
 
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
 
Charles Sharp: Java 8 Streams
Charles Sharp: Java 8 StreamsCharles Sharp: Java 8 Streams
Charles Sharp: Java 8 Streams
 
Java 8 Workshop
Java 8 WorkshopJava 8 Workshop
Java 8 Workshop
 

More from Son Nguyen

Wsdl connector introduction
Wsdl connector introductionWsdl connector introduction
Wsdl connector introductionSon Nguyen
 
Android intergrate with mule
Android intergrate with muleAndroid intergrate with mule
Android intergrate with muleSon Nguyen
 
Mule flow overview
Mule flow overviewMule flow overview
Mule flow overviewSon Nguyen
 
Mule flow and filter
Mule flow and filterMule flow and filter
Mule flow and filterSon Nguyen
 
Handle exceptions in mule
Handle exceptions in muleHandle exceptions in mule
Handle exceptions in muleSon Nguyen
 
Spring security integrate with mule
Spring security integrate with muleSpring security integrate with mule
Spring security integrate with muleSon Nguyen
 
Message processor in mule
Message processor in muleMessage processor in mule
Message processor in muleSon Nguyen
 
Expression language in mule
Expression language in muleExpression language in mule
Expression language in muleSon Nguyen
 
Mule with data weave
Mule with data weaveMule with data weave
Mule with data weaveSon Nguyen
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler muleSon Nguyen
 
Composite source in bound and out-bound
Composite source in bound and out-boundComposite source in bound and out-bound
Composite source in bound and out-boundSon Nguyen
 
Batch job processing
Batch job processingBatch job processing
Batch job processingSon Nguyen
 
Using message enricher
Using message enricherUsing message enricher
Using message enricherSon Nguyen
 
Finance connectors with mule
Finance connectors with muleFinance connectors with mule
Finance connectors with muleSon Nguyen
 
Google drive connection
Google drive connectionGoogle drive connection
Google drive connectionSon Nguyen
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in muleSon Nguyen
 
Mule integrate with microsoft
Mule integrate with microsoftMule integrate with microsoft
Mule integrate with microsoftSon Nguyen
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectorsSon Nguyen
 
Mule esb basic introduction
Mule esb basic introductionMule esb basic introduction
Mule esb basic introductionSon Nguyen
 

More from Son Nguyen (20)

Wsdl connector introduction
Wsdl connector introductionWsdl connector introduction
Wsdl connector introduction
 
Android intergrate with mule
Android intergrate with muleAndroid intergrate with mule
Android intergrate with mule
 
Mule flow overview
Mule flow overviewMule flow overview
Mule flow overview
 
Mule flow and filter
Mule flow and filterMule flow and filter
Mule flow and filter
 
Handle exceptions in mule
Handle exceptions in muleHandle exceptions in mule
Handle exceptions in mule
 
Spring security integrate with mule
Spring security integrate with muleSpring security integrate with mule
Spring security integrate with mule
 
Message processor in mule
Message processor in muleMessage processor in mule
Message processor in mule
 
Expression language in mule
Expression language in muleExpression language in mule
Expression language in mule
 
Mule with data weave
Mule with data weaveMule with data weave
Mule with data weave
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler mule
 
Composite source in bound and out-bound
Composite source in bound and out-boundComposite source in bound and out-bound
Composite source in bound and out-bound
 
Batch job processing
Batch job processingBatch job processing
Batch job processing
 
Using message enricher
Using message enricherUsing message enricher
Using message enricher
 
Finance connectors with mule
Finance connectors with muleFinance connectors with mule
Finance connectors with mule
 
Google drive connection
Google drive connectionGoogle drive connection
Google drive connection
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in mule
 
Mule integrate with microsoft
Mule integrate with microsoftMule integrate with microsoft
Mule integrate with microsoft
 
Jms queue
Jms queueJms queue
Jms queue
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectors
 
Mule esb basic introduction
Mule esb basic introductionMule esb basic introduction
Mule esb basic introduction
 

Recently uploaded

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Recently uploaded (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Java 8 New features

  • 2. Significant Improvements New features in the language Aggregate operations Compact profiles Date-time package HotSpot
  • 3. Other Improvement (Not Covered Here) Collections Security JavaFX Tools Internationalization Scripting IO and NIO ● java.lang and java.util ● Networking ● Concurrency
  • 4. New Features in The Language lambda functions method references default methods static methods (in interfaces)
  • 5. Lambda Expressions Lambda expressions are applicable only to functional interfaces. “A functional interface is any interface that contains only one abstract method.” “You can consider lambda expressions as anonymous methods - methods without a name.”
  • 6. Lambdas. Suitable Places Variable declarations Assignments Return statements Array initializers Method or constructor arguments Lambda expression bodies Conditional expressions, ?: Cast expressions
  • 7. Currying in Java 8? In Scala we can do this: object.curry(x)(y); Can we do the same in Java 8?
  • 8. Method References “Compact, easy-to-read lambda expressions for methods that already have a name”
  • 9. Default Method Nice construct. Extremely suitable for enhancing existing interfaces in libraries.
  • 10. Default Method. Options for Implementing class Not mention the default method at all, which lets your extended interface inherit the default method. Redeclare the default method, which makes it abstract. Redefine the default method, which overrides it.
  • 11. Static Method. Definition “A static method is a method that is associated with the class in which it is defined rather than with any object. Every instance of the class shares its static methods.” - Oracle Useful to keep interface-related method in… the interface itself!
  • 12. Aggregate Operations Stream is a sequence of elements supporting sequential and parallel aggregate operations. A pipeline is a sequence of aggregate operations.
  • 13. Pipeline parts public void doStream(List<String> list) { list.stream() .filter(s -> s.length() > 5) .forEach(s -> System.out.println(s)); } Source Intermediate operations (optional) Terminal operation
  • 14. Aggregations vs Iterators Aggregation Iterators Internal iteration External iteration Parallel iteration Sequential iteration Works with stream Works with collection Accept lambda parameters -
  • 15. Parallel Streams public void doStream(List<String> list) { list.stream() .filter(s -> s.length() > 5) .forEach(s -> System.out.println(s)); } public void doStream(List<String> list) { list.parallelStream() .filter(s -> s.length() > 5) .forEach(s -> System.out.println(s)); }
  • 16. Parallel Stream Pitfalls Single ForkJoinPool is used by default. Do not use stateful lambdas. Source of the stream may never be modified in pipeline. Use with extreme care in container environment (e.g. in EE).
  • 18. Date-Time Classes overview DayOfWeem and Month enums Dates: LocalDate, YearMonth, MonthDay, Year Date & Time: LocalTime, LocalDateTime Time zones: ZoneId, ZoneOffset, ZonedDateTime, OffsetDateTime, OffsetTime Instant Period and Duration
  • 19. Compact Profiles. Summary The problem - the size of JRE is huge and growing. Target - modularization of JRE. Work started as Project Jigsaw. Java 8 brings compact profiles. Full modularization planned for Java 9.
  • 20. HotSpot PermGen removed AES is done on (capable) CPU Supports default methods
  • 21. Metaspace Highlights Reduced amount of class metadata Limited by amount of native memory (by default) Per-class loader spaces Improved full collection time Huge improvement potential in Java 9 :)
  • 22. AES on CPU Enabled by default -XX:+UseAES -XX:+UseAESIntrinsics -XX:-UseAES -XX:-UseAESIntrinsics Works only on some Intel CPU’s (manufactured in 2010 or later) Does no work on AMD CPU’s

Editor's Notes

  1. in other place the compiler can’t determine lambda type