SlideShare a Scribd company logo
1 of 47
Master the Concepts Behind the Java 10
Challenges and Eliminate Stressful Bugs
What we will do together...
Learn 10 recently released Java core concepts
by solving fun challenges
Lets learn together…
9 10
Topics we will cover
1. Interface
2. Optional
3. Reactive Streams
4. Try with resources
5. Take and drop while
6. CompletableFuture
7. Type Inference (var!)
8. Collection Factories
9. Functional Interfaces
10. ProcessHandle API
Get to know me...
Rafael Del Nero
- Made in Brazil
- Java Champion
- Quiz master in Oracle Dev Gym
- Creator of the Java Challengers series in Java World
- Creator of nobugsproject.com
- Author of "No Bugs, No Stress - Create a Life Changing
Software Without Destroying Your Life” book.
Topics we will cover – Part I
1. Interface
2. Optional
3. Reactive Streams
4. Try with resources
5. Take and drop while
Interface #1
A) LukeSFSYoda
B) LukeXYoda
C) It won’t compile
D) SLukeFSYoda
Interface #1
A) LukeSFSYoda
B) LukeXYoda
C) It won’t compile
D) SLukeFSYoda
Class != interface
private methods on interfaces
Default methods
Interface #1
A) LukeSFSYoda
B) LukeXYoda
C) It won’t compile
D) SLukeFSYoda
Class != interface
private methods on interfaces
Default methods
Optional #2
A) keyMakerVirus2theOneTRINITY
B) keyMakerVirusArchitect2theOneTRINITY
C) Virus1theOneTRINITY
D) keyMakerVirus1theOne
Optional #2
A) keyMakerVirus2theOneTRINITY
B) keyMakerVirusArchitect2theOneTRINITY
C) Virus1theOneTRINITY
D) keyMakerVirus1theOne
orElse
orElseGet
or
Optional #2
A) keyMakerVirus2theOneTRINITY
B) keyMakerVirusArchitect2theOneTRINITY
C) Virus1theOneTRINITY
D) keyMakerVirus1theOne
Optional #2
A) keyMakerVirus2theOneTRINITY
B) keyMakerVirusArchitect2theOneTRINITY
C) Virus1theOneTRINITY
D) keyMakerVirus1theOne
orElse
orElseGet
or
Reactive Streams #3
A) Homer Barney Lenny
Moe, get the shotgun
B) Homer No beer.
Moe, get the shotgun
C) It will be a random result
D) Homer Barney Lenny
and StackOverflowError will be thrown
Asynchronous process
Reactive Streams #3
A) Homer Barney Lenny
Moe, get the shotgun
B) Homer No beer.
Moe, get the shotgun
C) It will be a random result
D) Homer Barney Lenny
and StackOverflowError will be thrown
Asynchronous process
++ operator
Daemon and non-daemon Thread
Reactive Streams #3
A) Homer Barney Lenny
Moe, get the shotgun
B) Homer No beer.
Moe, get the shotgun
C) It will be a random result
D) Homer Barney Lenny
and StackOverflowError will be thrown
Reactive Streams #3
A) Homer Barney Lenny
Moe, get the shotgun
B) Homer No beer.
Moe, get the shotgun
C) It will be a random result
D) Homer Barney Lenny
and StackOverflowError will be thrown
Asynchronous process
++ operator
Daemon and non-daemon Thread
Try with resources #4
A) IOException will be thrown
B) >#?#1
C) >>#?#2
D) >#? then IOException will be thrown
Try with resources #4
A) IOException will be thrown
B) >#?#1
C) >>#?#2
D) >#? then IOException will be thrown
Closable can be passed from outside since
Java 9
Close method is invoked after try block is
executed
No need to use finally to close resources
Try with resources #4
A) IOException will be thrown
B) >#?#1
C) >>#?#2
D) >#? then IOException will be thrown
Closable can be passed from outside since
Java 9
Close method is invoked after try block is
executed
No need to use finally to close resources
Try with resources #4
A) IOException will be thrown
B) >#?#1
C) >>#?#2
D) >#? then IOException will be thrown
Try with resources #4
A) IOException will be thrown
B) >#?#1
C) >>#?#2
D) >#? then IOException will be thrown
Closable can be passed from outside since
Java 9
Close method is invoked after try block is
executed
No need to use finally to close resources
Take and drop while #5
A) 76578
B) 78657
C) 786578
D) 7 and random values
Take and drop while #5
A) 76578
B) 78657
C) 786578
D) 7 and random values
Take and Drop while will break when the
condition is false
Set interface has unordered elements
Stream.flatMap()
Take and drop while #5
A) 76578
B) 78657
C) 786578
D) 7 and random values
Take and drop while #5
A) 76578
B) 78657
C) 786578
D) 7 and random values
Take and Drop while will break when the
condition is false
Set interface has unordered elements
Stream.flatMap()
6. CompletableFuture
7. Type Inference (var!)
8. Collection Factories
9. Functional Interfaces
10. ProcessHandle API
Topics we will cover – Part II
- Java ==  since 2007
- Consultant @ Version 1
- 💚 Clean Code & TDD
Get to know me...
Barry Evans
- Made in (N) Ireland
- Live in Dublin
- Dublin Java User Group Co-lead
- http://DubJUG.org
- 💔 Bugs & Untested Code
A)
time to go home :( Rating: 0
& the jvm terminates
B)
time to go home :( Rating: 14
& the jvm terminates
C)
time to go home :( Rating: 14
& the jvm does not terminate
D)
Rating: 14 time to go home :(
& the jvm does not terminate
Completable
Future #6
A)
time to go home :( Rating: 0
& the jvm terminates
B)
Rating: 14 time to go home :(
& the jvm terminates
C)
time to go home :( Rating: 14
& the jvm does not terminate
D)
Rating: 14 time to go home :(
& the jvm does not terminate
Completable
Future #6
CF’s – Declarative task pipelines
Good use of Threads
completeAsync() – Java 9
ExecutorService.shutdown()
A) a:c:e:g
B) b:c:f:g
C) b:c:e:g
D) Throws
java.lang.
ClassCastException
at line 21
Type Inference #7
A) a:c:e:g
B) b:c:f:g
C) b:c:e:g
D) Throws
java.lang.
ClassCastException
at line 21
Type Inference #7
Non-Denotable types
Assigning null to var
var is not a keyword
A) a:c:e:g
B) b:c:f:g
C) b:c:e:g
D) Throws
java.lang.
ClassCastException
at line 21
Type Inference #7
A) a:c:e:g
B) b:c:f:g
C) b:c:e:g
D) Throws
java.lang.
ClassCastException
at line 21
Type Inference #7
No compile-time exception checking
A) a:c:e:g
B) b:c:f:g
C) b:c:e:g
D) Throws
java.lang.
ClassCastException
at line 21
Type Inference #7
Non-Denotable types
Assigning null to var
var is not a keyword
A) no space for Marvel
heros here!|Where are
the villains?
B) no space for villains
and exits
C) Harley Quinn, Joker,
Riddler
D) Joker, Riddler, Joker
Collection
Factories #8
A) no space for Marvel
heros here!|Where are
the villains?
B) no space for villains
and exits
C) Harley Quinn, Joker,
Riddler
D) Joker, Riddler, Joker
Collection
Factories #8
of() provides Immutable collections
Set.copyOf() & duplicates 
Set.of() & duplicates 
A) no space for Marvel
heros here!|Where are
the villains?
B) no space for villains
and exits
C) Harley Quinn, Joker,
Riddler
D) Joker, Riddler, Joker
Collection
Factories #8Immutable Collections
Not assigned
Java 10
Duplicates not allowed
A) no space for Marvel
heros here!|Where are
the villains?
B) no space for villains
and exits
C) Harley Quinn, Joker,
Riddler
D) Joker, Riddler, Joker
Collection
Factories #8
of() provides Immutable collections
Set.copyOf() & duplicates 
Set.of() & duplicates 
Functional
Interfaces #9
A) -2
B) 1
C) 4
D) Throws
java.lang.ArithmeticException:
/ by zero
A) -2
B) 1
C) 4
D) Throws
java.lang.ArithmeticException:
/ by zero
Functional
Interfaces #9
A) -2
B) 1
C) 4
D) Throws
java.lang.ArithmeticException:
/ by zero
Assign functional interfaces to fields
andThen() chaining is like a pipe |
Function | BiFunction | BiConsmer
A) -2
B) 1
C) 4
D) Throws
java.lang.ArithmeticException:
/ by zero
Functional
Interfaces #9
= 2
Does nothing
= 4
4
2/4 == 0.5 == 0
A) -2
B) 1
C) 4
D) Throws
java.lang.ArithmeticException:
/ by zero
= 4
1
2
3
4
5
6
A) -2
B) 1
C) 4
D) Throws
java.lang.ArithmeticException:
/ by zero
Functional
Interfaces #9
Assign functional interfaces to fields
andThen() chaining is like a pipe |
Function | BiFunction | BiConsmer
A) Yum Yum Piggy : 0
Yum Yum Piggy : 1
Yum Yum Piggy : 2
B) Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred.
Program will exit.
Unrecognized option: --list-modules
C) Wolf for dinner!
Wolf for dinner!
Yum Yum Piggy : 3
D) Yum Yum Piggy : 1
Yum Yum Piggy : 2
Wolf for dinner!
ProcessHandle API
#10
A) Yum Yum Piggy : 0
Yum Yum Piggy : 1
Yum Yum Piggy : 2
B) Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred.
Program will exit.
Unrecognized option: --list-modules
C) Wolf for dinner!
Wolf for dinner!
Yum Yum Piggy : 3
D) Yum Yum Piggy : 1
Yum Yum Piggy : 2
Wolf for dinner!
ProcessHandle API
#10
ProcessHandle | ProcessHandle.Info
Java 9
liveness, children, pid, destroy
ProcessHandle.onExit() 
CompletableFuture
Topics we covered
1. Interface
2. Optional
3. Reactive Streams
4. Try with resources
5. Take and drop while
6. CompletableFuture
7. Type Inference (var!)
8. Collection Factories
9. Functional Interfaces
10. ProcessHandle API
Have a wonderful @OracleCodeOne!
Master the Concepts Behind the Java 10
Challenges and Eliminate Stressful Bugs
@rafaDelNero @bazza_ni

More Related Content

What's hot

Decompiling Java - SCAM2009 Presentation
Decompiling Java - SCAM2009 PresentationDecompiling Java - SCAM2009 Presentation
Decompiling Java - SCAM2009 PresentationJames Hamilton
 
Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011Anton Arhipov
 
Hotfixing iOS apps with Javascript
Hotfixing iOS apps with JavascriptHotfixing iOS apps with Javascript
Hotfixing iOS apps with JavascriptSergio Padrino Recio
 
Aprendendo solid com exemplos
Aprendendo solid com exemplosAprendendo solid com exemplos
Aprendendo solid com exemplosvinibaggio
 
C++ for Java Developers (JavaZone 2017)
C++ for Java Developers (JavaZone 2017)C++ for Java Developers (JavaZone 2017)
C++ for Java Developers (JavaZone 2017)Patricia Aas
 
Thoughts On Learning A New Programming Language
Thoughts On Learning A New Programming LanguageThoughts On Learning A New Programming Language
Thoughts On Learning A New Programming LanguagePatricia Aas
 
Developer Android Tools
Developer Android ToolsDeveloper Android Tools
Developer Android ToolsMacha DA COSTA
 

What's hot (9)

Decompiling Java - SCAM2009 Presentation
Decompiling Java - SCAM2009 PresentationDecompiling Java - SCAM2009 Presentation
Decompiling Java - SCAM2009 Presentation
 
Getting Testy With Perl6
Getting Testy With Perl6Getting Testy With Perl6
Getting Testy With Perl6
 
Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011
 
Hotfixing iOS apps with Javascript
Hotfixing iOS apps with JavascriptHotfixing iOS apps with Javascript
Hotfixing iOS apps with Javascript
 
Smoking docker
Smoking dockerSmoking docker
Smoking docker
 
Aprendendo solid com exemplos
Aprendendo solid com exemplosAprendendo solid com exemplos
Aprendendo solid com exemplos
 
C++ for Java Developers (JavaZone 2017)
C++ for Java Developers (JavaZone 2017)C++ for Java Developers (JavaZone 2017)
C++ for Java Developers (JavaZone 2017)
 
Thoughts On Learning A New Programming Language
Thoughts On Learning A New Programming LanguageThoughts On Learning A New Programming Language
Thoughts On Learning A New Programming Language
 
Developer Android Tools
Developer Android ToolsDeveloper Android Tools
Developer Android Tools
 

Similar to Master the Concepts Behind the Java 10 Challenges and Eliminate Stressful Bugs

ITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVM
ITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVMITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVM
ITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVMIstanbul Tech Talks
 
JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015Charles Nutter
 
Code lifecycle in the jvm - TopConf Linz
Code lifecycle in the jvm - TopConf LinzCode lifecycle in the jvm - TopConf Linz
Code lifecycle in the jvm - TopConf LinzIvan Krylov
 
Test First Teaching
Test First TeachingTest First Teaching
Test First TeachingSarah Allen
 
Java Basics
Java BasicsJava Basics
Java BasicsSunil OS
 
JavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdfJavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdfSathwika7
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaCharles Nutter
 
Learn the Concepts Behind Those 10 Java Challenges and Eliminate Stressful Bugs
Learn the Concepts Behind Those 10 Java Challenges and Eliminate Stressful BugsLearn the Concepts Behind Those 10 Java Challenges and Eliminate Stressful Bugs
Learn the Concepts Behind Those 10 Java Challenges and Eliminate Stressful BugsRafael Chinelato Del Nero
 
Monkeybars in the Manor
Monkeybars in the ManorMonkeybars in the Manor
Monkeybars in the Manormartinbtt
 
Java notes | All Basics |
Java notes | All Basics |Java notes | All Basics |
Java notes | All Basics |ShubhamAthawane
 
Once Upon a Process
Once Upon a ProcessOnce Upon a Process
Once Upon a ProcessDavid Evans
 

Similar to Master the Concepts Behind the Java 10 Challenges and Eliminate Stressful Bugs (20)

Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
 
ITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVM
ITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVMITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVM
ITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVM
 
JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015
 
In Vogue Dynamic
In Vogue DynamicIn Vogue Dynamic
In Vogue Dynamic
 
Code lifecycle in the jvm - TopConf Linz
Code lifecycle in the jvm - TopConf LinzCode lifecycle in the jvm - TopConf Linz
Code lifecycle in the jvm - TopConf Linz
 
Test First Teaching
Test First TeachingTest First Teaching
Test First Teaching
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Java introduction
Java introductionJava introduction
Java introduction
 
55 New Features in Java 7
55 New Features in Java 755 New Features in Java 7
55 New Features in Java 7
 
JavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdfJavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdf
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible Java
 
Learn the Concepts Behind Those 10 Java Challenges and Eliminate Stressful Bugs
Learn the Concepts Behind Those 10 Java Challenges and Eliminate Stressful BugsLearn the Concepts Behind Those 10 Java Challenges and Eliminate Stressful Bugs
Learn the Concepts Behind Those 10 Java Challenges and Eliminate Stressful Bugs
 
Java Basic PART I
Java Basic PART IJava Basic PART I
Java Basic PART I
 
Intro to J Ruby
Intro to J RubyIntro to J Ruby
Intro to J Ruby
 
Monkeybars in the Manor
Monkeybars in the ManorMonkeybars in the Manor
Monkeybars in the Manor
 
Java notes | All Basics |
Java notes | All Basics |Java notes | All Basics |
Java notes | All Basics |
 
Once Upon a Process
Once Upon a ProcessOnce Upon a Process
Once Upon a Process
 
Java goes wild, lesson 1
Java goes wild, lesson 1Java goes wild, lesson 1
Java goes wild, lesson 1
 
Java For Automation
Java   For AutomationJava   For Automation
Java For Automation
 
Ruby Under The Hood
Ruby Under The HoodRuby Under The Hood
Ruby Under The Hood
 

Recently uploaded

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
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
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
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
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
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
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 

Recently uploaded (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
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...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
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)
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
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
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 

Master the Concepts Behind the Java 10 Challenges and Eliminate Stressful Bugs

  • 1. Master the Concepts Behind the Java 10 Challenges and Eliminate Stressful Bugs
  • 2. What we will do together... Learn 10 recently released Java core concepts by solving fun challenges
  • 4. Topics we will cover 1. Interface 2. Optional 3. Reactive Streams 4. Try with resources 5. Take and drop while 6. CompletableFuture 7. Type Inference (var!) 8. Collection Factories 9. Functional Interfaces 10. ProcessHandle API
  • 5. Get to know me... Rafael Del Nero - Made in Brazil - Java Champion - Quiz master in Oracle Dev Gym - Creator of the Java Challengers series in Java World - Creator of nobugsproject.com - Author of "No Bugs, No Stress - Create a Life Changing Software Without Destroying Your Life” book.
  • 6. Topics we will cover – Part I 1. Interface 2. Optional 3. Reactive Streams 4. Try with resources 5. Take and drop while
  • 7. Interface #1 A) LukeSFSYoda B) LukeXYoda C) It won’t compile D) SLukeFSYoda
  • 8. Interface #1 A) LukeSFSYoda B) LukeXYoda C) It won’t compile D) SLukeFSYoda Class != interface private methods on interfaces Default methods
  • 9. Interface #1 A) LukeSFSYoda B) LukeXYoda C) It won’t compile D) SLukeFSYoda Class != interface private methods on interfaces Default methods
  • 10. Optional #2 A) keyMakerVirus2theOneTRINITY B) keyMakerVirusArchitect2theOneTRINITY C) Virus1theOneTRINITY D) keyMakerVirus1theOne
  • 11. Optional #2 A) keyMakerVirus2theOneTRINITY B) keyMakerVirusArchitect2theOneTRINITY C) Virus1theOneTRINITY D) keyMakerVirus1theOne orElse orElseGet or
  • 12. Optional #2 A) keyMakerVirus2theOneTRINITY B) keyMakerVirusArchitect2theOneTRINITY C) Virus1theOneTRINITY D) keyMakerVirus1theOne
  • 13. Optional #2 A) keyMakerVirus2theOneTRINITY B) keyMakerVirusArchitect2theOneTRINITY C) Virus1theOneTRINITY D) keyMakerVirus1theOne orElse orElseGet or
  • 14. Reactive Streams #3 A) Homer Barney Lenny Moe, get the shotgun B) Homer No beer. Moe, get the shotgun C) It will be a random result D) Homer Barney Lenny and StackOverflowError will be thrown Asynchronous process
  • 15. Reactive Streams #3 A) Homer Barney Lenny Moe, get the shotgun B) Homer No beer. Moe, get the shotgun C) It will be a random result D) Homer Barney Lenny and StackOverflowError will be thrown Asynchronous process ++ operator Daemon and non-daemon Thread
  • 16. Reactive Streams #3 A) Homer Barney Lenny Moe, get the shotgun B) Homer No beer. Moe, get the shotgun C) It will be a random result D) Homer Barney Lenny and StackOverflowError will be thrown
  • 17. Reactive Streams #3 A) Homer Barney Lenny Moe, get the shotgun B) Homer No beer. Moe, get the shotgun C) It will be a random result D) Homer Barney Lenny and StackOverflowError will be thrown Asynchronous process ++ operator Daemon and non-daemon Thread
  • 18. Try with resources #4 A) IOException will be thrown B) >#?#1 C) >>#?#2 D) >#? then IOException will be thrown
  • 19. Try with resources #4 A) IOException will be thrown B) >#?#1 C) >>#?#2 D) >#? then IOException will be thrown Closable can be passed from outside since Java 9 Close method is invoked after try block is executed No need to use finally to close resources
  • 20. Try with resources #4 A) IOException will be thrown B) >#?#1 C) >>#?#2 D) >#? then IOException will be thrown Closable can be passed from outside since Java 9 Close method is invoked after try block is executed No need to use finally to close resources
  • 21. Try with resources #4 A) IOException will be thrown B) >#?#1 C) >>#?#2 D) >#? then IOException will be thrown
  • 22. Try with resources #4 A) IOException will be thrown B) >#?#1 C) >>#?#2 D) >#? then IOException will be thrown Closable can be passed from outside since Java 9 Close method is invoked after try block is executed No need to use finally to close resources
  • 23. Take and drop while #5 A) 76578 B) 78657 C) 786578 D) 7 and random values
  • 24. Take and drop while #5 A) 76578 B) 78657 C) 786578 D) 7 and random values Take and Drop while will break when the condition is false Set interface has unordered elements Stream.flatMap()
  • 25. Take and drop while #5 A) 76578 B) 78657 C) 786578 D) 7 and random values
  • 26. Take and drop while #5 A) 76578 B) 78657 C) 786578 D) 7 and random values Take and Drop while will break when the condition is false Set interface has unordered elements Stream.flatMap()
  • 27. 6. CompletableFuture 7. Type Inference (var!) 8. Collection Factories 9. Functional Interfaces 10. ProcessHandle API Topics we will cover – Part II
  • 28. - Java ==  since 2007 - Consultant @ Version 1 - 💚 Clean Code & TDD Get to know me... Barry Evans - Made in (N) Ireland - Live in Dublin - Dublin Java User Group Co-lead - http://DubJUG.org - 💔 Bugs & Untested Code
  • 29. A) time to go home :( Rating: 0 & the jvm terminates B) time to go home :( Rating: 14 & the jvm terminates C) time to go home :( Rating: 14 & the jvm does not terminate D) Rating: 14 time to go home :( & the jvm does not terminate Completable Future #6
  • 30. A) time to go home :( Rating: 0 & the jvm terminates B) Rating: 14 time to go home :( & the jvm terminates C) time to go home :( Rating: 14 & the jvm does not terminate D) Rating: 14 time to go home :( & the jvm does not terminate Completable Future #6 CF’s – Declarative task pipelines Good use of Threads completeAsync() – Java 9 ExecutorService.shutdown()
  • 31. A) a:c:e:g B) b:c:f:g C) b:c:e:g D) Throws java.lang. ClassCastException at line 21 Type Inference #7
  • 32. A) a:c:e:g B) b:c:f:g C) b:c:e:g D) Throws java.lang. ClassCastException at line 21 Type Inference #7 Non-Denotable types Assigning null to var var is not a keyword
  • 33. A) a:c:e:g B) b:c:f:g C) b:c:e:g D) Throws java.lang. ClassCastException at line 21 Type Inference #7
  • 34. A) a:c:e:g B) b:c:f:g C) b:c:e:g D) Throws java.lang. ClassCastException at line 21 Type Inference #7 No compile-time exception checking
  • 35. A) a:c:e:g B) b:c:f:g C) b:c:e:g D) Throws java.lang. ClassCastException at line 21 Type Inference #7 Non-Denotable types Assigning null to var var is not a keyword
  • 36. A) no space for Marvel heros here!|Where are the villains? B) no space for villains and exits C) Harley Quinn, Joker, Riddler D) Joker, Riddler, Joker Collection Factories #8
  • 37. A) no space for Marvel heros here!|Where are the villains? B) no space for villains and exits C) Harley Quinn, Joker, Riddler D) Joker, Riddler, Joker Collection Factories #8 of() provides Immutable collections Set.copyOf() & duplicates  Set.of() & duplicates 
  • 38. A) no space for Marvel heros here!|Where are the villains? B) no space for villains and exits C) Harley Quinn, Joker, Riddler D) Joker, Riddler, Joker Collection Factories #8Immutable Collections Not assigned Java 10 Duplicates not allowed
  • 39. A) no space for Marvel heros here!|Where are the villains? B) no space for villains and exits C) Harley Quinn, Joker, Riddler D) Joker, Riddler, Joker Collection Factories #8 of() provides Immutable collections Set.copyOf() & duplicates  Set.of() & duplicates 
  • 40. Functional Interfaces #9 A) -2 B) 1 C) 4 D) Throws java.lang.ArithmeticException: / by zero
  • 41. A) -2 B) 1 C) 4 D) Throws java.lang.ArithmeticException: / by zero Functional Interfaces #9 A) -2 B) 1 C) 4 D) Throws java.lang.ArithmeticException: / by zero Assign functional interfaces to fields andThen() chaining is like a pipe | Function | BiFunction | BiConsmer
  • 42. A) -2 B) 1 C) 4 D) Throws java.lang.ArithmeticException: / by zero Functional Interfaces #9 = 2 Does nothing = 4 4 2/4 == 0.5 == 0 A) -2 B) 1 C) 4 D) Throws java.lang.ArithmeticException: / by zero = 4 1 2 3 4 5 6
  • 43. A) -2 B) 1 C) 4 D) Throws java.lang.ArithmeticException: / by zero Functional Interfaces #9 Assign functional interfaces to fields andThen() chaining is like a pipe | Function | BiFunction | BiConsmer
  • 44. A) Yum Yum Piggy : 0 Yum Yum Piggy : 1 Yum Yum Piggy : 2 B) Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. Unrecognized option: --list-modules C) Wolf for dinner! Wolf for dinner! Yum Yum Piggy : 3 D) Yum Yum Piggy : 1 Yum Yum Piggy : 2 Wolf for dinner! ProcessHandle API #10
  • 45. A) Yum Yum Piggy : 0 Yum Yum Piggy : 1 Yum Yum Piggy : 2 B) Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. Unrecognized option: --list-modules C) Wolf for dinner! Wolf for dinner! Yum Yum Piggy : 3 D) Yum Yum Piggy : 1 Yum Yum Piggy : 2 Wolf for dinner! ProcessHandle API #10 ProcessHandle | ProcessHandle.Info Java 9 liveness, children, pid, destroy ProcessHandle.onExit()  CompletableFuture
  • 46. Topics we covered 1. Interface 2. Optional 3. Reactive Streams 4. Try with resources 5. Take and drop while 6. CompletableFuture 7. Type Inference (var!) 8. Collection Factories 9. Functional Interfaces 10. ProcessHandle API
  • 47. Have a wonderful @OracleCodeOne! Master the Concepts Behind the Java 10 Challenges and Eliminate Stressful Bugs @rafaDelNero @bazza_ni

Editor's Notes

  1. Non-Denotable types (like Anonymous Classes) can be inferred by var. assigning null to var var is not a keyword cons of using var why did Java use var? - show generics example Gen/1/2/3
  2. Non-Denotable types (like Anonymous Classes) can be inferred by var. assigning null to var var is not a keyword cons of using var why did Java use var? - show generics example Gen/1/2/3
  3. Non-Denotable types (like Anonymous Classes) can be inferred by var. assigning null to var var is not a keyword cons of using var why did Java use var? - show generics example Gen/1/2/3
  4. newInstance() effectively bypasses the compile-time exception checking
  5. Non-Denotable types (like Anonymous Classes) can be inferred by var. assigning null to var var is not a keyword cons of using var why did Java use var? - show generics example Gen/1/2/3