SlideShare a Scribd company logo
Hidetomo Moriomoto
http://github.com/mocchidesu
2014/05/05
* Brief history of Java
*What's new in Java 8
*Why Lambda?
* Sample Program &&
Bench mark
James Gosling: Father of Java
Date Version Highlights
1991 Oak by James Gosling@Sun
Microsystems
Named after oak tree stood
outside his office. For small
PDA device. Slight flavor of C
1996 Jan 23 JDK 1.0 “Oak” sounds similar to “awk”?
1997 Java 1.1 JDBC, reflection, JIT compiler
1998 Java2 (J2SE) Collection framework,
Swing(GUI)API
2000 Java 1.3 JNDI, RMI
2002 Feb. Java 1.4 Regex, JAXP
2004 Sept. Java 1.5 Generics, annotation, enum,
concurrency, varargs
2006 Dec. Java 1.6 Performance tune, JDBC4
2011 July Java 1.7 JVM support dynamic language
Features
DateTime API (no more new Date(), Calendar.getInstance()!)
Nashborn JavaScript engine ($JAVA_HOME/bin/jjs)
Default method in Interface / Improved concurrent package /
Optional
Lambda expressions
@FunctionalInterface annotations
Method Reference
java.util.Stream package
Backward Compatibility
Binary compatibility && Behavioral compatibility - Excellent
Source compatibility - Good
Lambda is a syntax that produces instance of
Functional Interface.
Functional Interface is:
Interface that has exactly one abstract method
- Runnable ( run() )
- Comparator (compare() )
See
@FunctionalInterface (java.lang.annotation)
List of interface under java.util.function package
You can define your own interface, of course.
 Leap to functional language (Haskell, Erlang,
JavaScript, Lisp, Scala, Ocaml, etc.)
 Single-method interface (syntax sugar)
 Provide a path to multicore (stream vs.
parallel stream) -> see demo.
 No more for loop (internal loop vs. external
loop)
In short … function is the 1st level Object
/*
* JavaScript can pass method as a parameter.
*/
var doSomething = function(name){
console.log(name + "is going to do something someday");
}
function useSomething(func, param){
func(param);
}
Event handler
(parameter) -> { // do something} ; // that’s it!
Further simplify with “Type interface” - best guess
@FunctionalInterface
private interface HelloWorld{
public String hello(String name);
}
Old anonymous class
HelloWorld hello = new HelloWorld() {
@Override
public String hello(String name) {
return "Hello, " + name;
}
};
Ex 1) -> Get Simplified with Lambda (You don’t need to specify method name)
(String name) -> { return “Hello “+name + “!!”; };
Ex 2) Remove String -> JVM best guess – type interface
(name) -> { return “Hello “+name+”!!”; };
Ex 3) Remove return – type interface
(name) -> { “Hello “+name+”!!”; };
Ex 4) Remove brackets for single implementation.
(name) -> “Hello “+name+”!!”;
Ex 5) Remove () if parameter is one
name -> “Hello “+name+”!!”;
(name -> “Hello “+name+”!!”;
 Start with .stream(), chain with intermediate
operators, end with terminal operator.
 IntermediateOperator
(filter, map, sorted, distinct, limit)
 Terminal Operator
(forEach, collect, reduce, iterator)
 listOfSomething.stream()
.filter( element -> element.age > 30) //
.map( ) // not evaluated
.sorted() // not evaluated
.limit() // not evaluated
….
.collect( Collectors.toList() );  Finally evaluate
Sample Code (Run com.hidetomo.Java8StreamBench.main)
https://github.com/mocchidesu/Java8sample.git
Input: 100,000 last name from HSA
Do:
Filter: Last name start with ‘m’
Map: (Brace each name with [] bracket)
Sort: Reverse order
Dedupe
Limit to top 2 results
Loop 1000 times.
Traditional Java7 For Loop approach vs. Sequential
Lambda vs. Parallel Lambda. -> IntelliJ13
 Java 8 is backward compatible in binary level
 Lambda is not only a syntax sugar
 It’s a new era of Java
 Performance gain?Will be improved. Stay
tuned.
 When use? NOW
Everything about Java 8
http://www.techempower.com/blog/2013/03/26/everything-about-java-8/
Oracle Compatibility Guide for JDK 8
http://www.oracle.com/technetwork/java/javase/8-compatibility-guide-
2156366.html
Lambda Peek under the Hood by Brian Goetz - Java One 2013
http://www.slideshare.net/jaxlondon2012/lambda-a-peek-under-the-hood-brian-
goetz
10 Example of Lambda Expressions and Streams in Java 8
http://javarevisited.blogspot.com/2014/02/10-example-of-lambda-expressions-in-
java8.html
 Github.com/hidetomo/java8sample.git
 Slideshare /hidetomomorimoto

More Related Content

What's hot

ORMs in Golang
ORMs in GolangORMs in Golang
ORMs in Golang
Ikenna Okpala
 
ES2015 (ES6) Overview
ES2015 (ES6) OverviewES2015 (ES6) Overview
ES2015 (ES6) Overview
hesher
 
ES6 in Production [JSConfUY2015]
ES6 in Production [JSConfUY2015]ES6 in Production [JSConfUY2015]
ES6 in Production [JSConfUY2015]
Guillermo Paz
 
Clojure and the Web
Clojure and the WebClojure and the Web
Clojure and the Web
nickmbailey
 
Building a java tracer
Building a java tracerBuilding a java tracer
Building a java tracerrahulrevo
 
Seeking Clojure
Seeking ClojureSeeking Clojure
Seeking Clojure
chrisriceuk
 
Nick Sieger JRuby Concurrency EMRubyConf 2011
Nick Sieger JRuby Concurrency EMRubyConf 2011Nick Sieger JRuby Concurrency EMRubyConf 2011
Nick Sieger JRuby Concurrency EMRubyConf 2011
Nick Sieger
 
모던자바의 역습
모던자바의 역습모던자바의 역습
모던자바의 역습
DoHyun Jung
 
JSR 172: XML Parsing in MIDP
JSR 172: XML Parsing in MIDPJSR 172: XML Parsing in MIDP
JSR 172: XML Parsing in MIDPJussi Pohjolainen
 
NIO and NIO2
NIO and NIO2NIO and NIO2
ES6: Features + Rails
ES6: Features + RailsES6: Features + Rails
ES6: Features + Rails
Santosh Wadghule
 
What`s new in Java 7
What`s new in Java 7What`s new in Java 7
What`s new in Java 7
Georgian Micsa
 
Mastering Java Bytecode With ASM - 33rd degree, 2012
Mastering Java Bytecode With ASM - 33rd degree, 2012Mastering Java Bytecode With ASM - 33rd degree, 2012
Mastering Java Bytecode With ASM - 33rd degree, 2012Anton Arhipov
 
Explaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to ComeExplaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to Come
Cory Forsyth
 
Ruby on Rails Oracle adaptera izstrāde
Ruby on Rails Oracle adaptera izstrādeRuby on Rails Oracle adaptera izstrāde
Ruby on Rails Oracle adaptera izstrādeRaimonds Simanovskis
 
ゼロから始めるScalaプロジェクト
ゼロから始めるScalaプロジェクトゼロから始めるScalaプロジェクト
ゼロから始めるScalaプロジェクト
Ryuichi ITO
 
Hacking Mac OSX Cocoa API from Perl
Hacking Mac OSX Cocoa API from PerlHacking Mac OSX Cocoa API from Perl
Hacking Mac OSX Cocoa API from Perltypester
 
Mastering Java ByteCode
Mastering Java ByteCodeMastering Java ByteCode
Mastering Java ByteCode
Ecommerce Solution Provider SysIQ
 
The Art of JVM Profiling
The Art of JVM ProfilingThe Art of JVM Profiling
The Art of JVM Profiling
Andrei Pangin
 
Shell script-sec
Shell script-secShell script-sec
Shell script-sec
SRIKANTH ANDE
 

What's hot (20)

ORMs in Golang
ORMs in GolangORMs in Golang
ORMs in Golang
 
ES2015 (ES6) Overview
ES2015 (ES6) OverviewES2015 (ES6) Overview
ES2015 (ES6) Overview
 
ES6 in Production [JSConfUY2015]
ES6 in Production [JSConfUY2015]ES6 in Production [JSConfUY2015]
ES6 in Production [JSConfUY2015]
 
Clojure and the Web
Clojure and the WebClojure and the Web
Clojure and the Web
 
Building a java tracer
Building a java tracerBuilding a java tracer
Building a java tracer
 
Seeking Clojure
Seeking ClojureSeeking Clojure
Seeking Clojure
 
Nick Sieger JRuby Concurrency EMRubyConf 2011
Nick Sieger JRuby Concurrency EMRubyConf 2011Nick Sieger JRuby Concurrency EMRubyConf 2011
Nick Sieger JRuby Concurrency EMRubyConf 2011
 
모던자바의 역습
모던자바의 역습모던자바의 역습
모던자바의 역습
 
JSR 172: XML Parsing in MIDP
JSR 172: XML Parsing in MIDPJSR 172: XML Parsing in MIDP
JSR 172: XML Parsing in MIDP
 
NIO and NIO2
NIO and NIO2NIO and NIO2
NIO and NIO2
 
ES6: Features + Rails
ES6: Features + RailsES6: Features + Rails
ES6: Features + Rails
 
What`s new in Java 7
What`s new in Java 7What`s new in Java 7
What`s new in Java 7
 
Mastering Java Bytecode With ASM - 33rd degree, 2012
Mastering Java Bytecode With ASM - 33rd degree, 2012Mastering Java Bytecode With ASM - 33rd degree, 2012
Mastering Java Bytecode With ASM - 33rd degree, 2012
 
Explaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to ComeExplaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to Come
 
Ruby on Rails Oracle adaptera izstrāde
Ruby on Rails Oracle adaptera izstrādeRuby on Rails Oracle adaptera izstrāde
Ruby on Rails Oracle adaptera izstrāde
 
ゼロから始めるScalaプロジェクト
ゼロから始めるScalaプロジェクトゼロから始めるScalaプロジェクト
ゼロから始めるScalaプロジェクト
 
Hacking Mac OSX Cocoa API from Perl
Hacking Mac OSX Cocoa API from PerlHacking Mac OSX Cocoa API from Perl
Hacking Mac OSX Cocoa API from Perl
 
Mastering Java ByteCode
Mastering Java ByteCodeMastering Java ByteCode
Mastering Java ByteCode
 
The Art of JVM Profiling
The Art of JVM ProfilingThe Art of JVM Profiling
The Art of JVM Profiling
 
Shell script-sec
Shell script-secShell script-sec
Shell script-sec
 

Viewers also liked

Silabo abril agosto 2016 sicoa 2
Silabo abril agosto 2016 sicoa 2Silabo abril agosto 2016 sicoa 2
Silabo abril agosto 2016 sicoa 2
Henry Drucs
 
Her Hyundai has 5 seats. 2 in the front, 3 in the back.
Her Hyundai has 5 seats. 2 in the front, 3 in the back.Her Hyundai has 5 seats. 2 in the front, 3 in the back.
Her Hyundai has 5 seats. 2 in the front, 3 in the back.c9usera
 
Nodejs on 02/22/2012
Nodejs on 02/22/2012Nodejs on 02/22/2012
Nodejs on 02/22/2012
Hidetomo Morimoto
 
Aspectos preliminares
Aspectos preliminaresAspectos preliminares
Aspectos preliminares
Henry Drucs
 

Viewers also liked (10)

Web quest final
Web quest finalWeb quest final
Web quest final
 
Silabo abril agosto 2016 sicoa 2
Silabo abril agosto 2016 sicoa 2Silabo abril agosto 2016 sicoa 2
Silabo abril agosto 2016 sicoa 2
 
Her Hyundai has 5 seats. 2 in the front, 3 in the back.
Her Hyundai has 5 seats. 2 in the front, 3 in the back.Her Hyundai has 5 seats. 2 in the front, 3 in the back.
Her Hyundai has 5 seats. 2 in the front, 3 in the back.
 
Orient localiz
Orient localizOrient localiz
Orient localiz
 
9
99
9
 
12
1212
12
 
Nodejs on 02/22/2012
Nodejs on 02/22/2012Nodejs on 02/22/2012
Nodejs on 02/22/2012
 
13
1313
13
 
7
77
7
 
Aspectos preliminares
Aspectos preliminaresAspectos preliminares
Aspectos preliminares
 

Similar to Java 8 briefing

JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing UpDavid Padbury
 
Java Intro
Java IntroJava Intro
Java Introbackdoor
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
Mattias Karlsson
 
LyonJUG : Comment Jigsaw est prêt à tuer le classpath
LyonJUG : Comment Jigsaw est prêt à tuer le classpathLyonJUG : Comment Jigsaw est prêt à tuer le classpath
LyonJUG : Comment Jigsaw est prêt à tuer le classpath
Alexis Hassler
 
LyonJUG : Comment Jigsaw est prêt à tuer le classpath
LyonJUG : Comment Jigsaw est prêt à tuer le classpath LyonJUG : Comment Jigsaw est prêt à tuer le classpath
LyonJUG : Comment Jigsaw est prêt à tuer le classpath
Alexis Hassler
 
A brief tour of modern Java
A brief tour of modern JavaA brief tour of modern Java
A brief tour of modern Java
Sina Madani
 
55 New Features in Java 7
55 New Features in Java 755 New Features in Java 7
55 New Features in Java 7
Boulder Java User's Group
 
Xml Java
Xml JavaXml Java
Xml Javacbee48
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
Skills Matter
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws
loffenauer
 
Модерни езици за програмиране за JVM (2011)
Модерни езици за програмиране за JVM (2011)Модерни езици за програмиране за JVM (2011)
Модерни езици за програмиране за JVM (2011)
Bozhidar Batsov
 
wtf is in Java/JDK/wtf7?
wtf is in Java/JDK/wtf7?wtf is in Java/JDK/wtf7?
wtf is in Java/JDK/wtf7?
Scott Leberknight
 
Pure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools RacePure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools Race
Baruch Sadogursky
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lispelliando dias
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)
Pavlo Baron
 
Scala
ScalaScala
Java 7 Language Enhancement
Java 7 Language EnhancementJava 7 Language Enhancement
Java 7 Language Enhancement
muthusvm
 
Beyond java8
Beyond java8Beyond java8
Beyond java8
Muhammad Durrah
 
From Java To Clojure (English version)
From Java To Clojure (English version)From Java To Clojure (English version)
From Java To Clojure (English version)
Kent Ohashi
 

Similar to Java 8 briefing (20)

JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
Java Intro
Java IntroJava Intro
Java Intro
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
 
LyonJUG : Comment Jigsaw est prêt à tuer le classpath
LyonJUG : Comment Jigsaw est prêt à tuer le classpathLyonJUG : Comment Jigsaw est prêt à tuer le classpath
LyonJUG : Comment Jigsaw est prêt à tuer le classpath
 
LyonJUG : Comment Jigsaw est prêt à tuer le classpath
LyonJUG : Comment Jigsaw est prêt à tuer le classpath LyonJUG : Comment Jigsaw est prêt à tuer le classpath
LyonJUG : Comment Jigsaw est prêt à tuer le classpath
 
A brief tour of modern Java
A brief tour of modern JavaA brief tour of modern Java
A brief tour of modern Java
 
55 New Features in Java 7
55 New Features in Java 755 New Features in Java 7
55 New Features in Java 7
 
Xml Java
Xml JavaXml Java
Xml Java
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws
 
Модерни езици за програмиране за JVM (2011)
Модерни езици за програмиране за JVM (2011)Модерни езици за програмиране за JVM (2011)
Модерни езици за програмиране за JVM (2011)
 
wtf is in Java/JDK/wtf7?
wtf is in Java/JDK/wtf7?wtf is in Java/JDK/wtf7?
wtf is in Java/JDK/wtf7?
 
Project Coin
Project CoinProject Coin
Project Coin
 
Pure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools RacePure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools Race
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lisp
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)
 
Scala
ScalaScala
Scala
 
Java 7 Language Enhancement
Java 7 Language EnhancementJava 7 Language Enhancement
Java 7 Language Enhancement
 
Beyond java8
Beyond java8Beyond java8
Beyond java8
 
From Java To Clojure (English version)
From Java To Clojure (English version)From Java To Clojure (English version)
From Java To Clojure (English version)
 

Recently uploaded

By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 

Recently uploaded (20)

By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 

Java 8 briefing

  • 2. * Brief history of Java *What's new in Java 8 *Why Lambda? * Sample Program && Bench mark James Gosling: Father of Java
  • 3. Date Version Highlights 1991 Oak by James Gosling@Sun Microsystems Named after oak tree stood outside his office. For small PDA device. Slight flavor of C 1996 Jan 23 JDK 1.0 “Oak” sounds similar to “awk”? 1997 Java 1.1 JDBC, reflection, JIT compiler 1998 Java2 (J2SE) Collection framework, Swing(GUI)API 2000 Java 1.3 JNDI, RMI 2002 Feb. Java 1.4 Regex, JAXP 2004 Sept. Java 1.5 Generics, annotation, enum, concurrency, varargs 2006 Dec. Java 1.6 Performance tune, JDBC4 2011 July Java 1.7 JVM support dynamic language
  • 4. Features DateTime API (no more new Date(), Calendar.getInstance()!) Nashborn JavaScript engine ($JAVA_HOME/bin/jjs) Default method in Interface / Improved concurrent package / Optional Lambda expressions @FunctionalInterface annotations Method Reference java.util.Stream package Backward Compatibility Binary compatibility && Behavioral compatibility - Excellent Source compatibility - Good
  • 5. Lambda is a syntax that produces instance of Functional Interface.
  • 6. Functional Interface is: Interface that has exactly one abstract method - Runnable ( run() ) - Comparator (compare() ) See @FunctionalInterface (java.lang.annotation) List of interface under java.util.function package You can define your own interface, of course.
  • 7.  Leap to functional language (Haskell, Erlang, JavaScript, Lisp, Scala, Ocaml, etc.)  Single-method interface (syntax sugar)  Provide a path to multicore (stream vs. parallel stream) -> see demo.  No more for loop (internal loop vs. external loop)
  • 8. In short … function is the 1st level Object /* * JavaScript can pass method as a parameter. */ var doSomething = function(name){ console.log(name + "is going to do something someday"); } function useSomething(func, param){ func(param); } Event handler
  • 9. (parameter) -> { // do something} ; // that’s it! Further simplify with “Type interface” - best guess @FunctionalInterface private interface HelloWorld{ public String hello(String name); } Old anonymous class HelloWorld hello = new HelloWorld() { @Override public String hello(String name) { return "Hello, " + name; } }; Ex 1) -> Get Simplified with Lambda (You don’t need to specify method name) (String name) -> { return “Hello “+name + “!!”; }; Ex 2) Remove String -> JVM best guess – type interface (name) -> { return “Hello “+name+”!!”; }; Ex 3) Remove return – type interface (name) -> { “Hello “+name+”!!”; }; Ex 4) Remove brackets for single implementation. (name) -> “Hello “+name+”!!”; Ex 5) Remove () if parameter is one name -> “Hello “+name+”!!”; (name -> “Hello “+name+”!!”;
  • 10.  Start with .stream(), chain with intermediate operators, end with terminal operator.  IntermediateOperator (filter, map, sorted, distinct, limit)  Terminal Operator (forEach, collect, reduce, iterator)
  • 11.  listOfSomething.stream() .filter( element -> element.age > 30) // .map( ) // not evaluated .sorted() // not evaluated .limit() // not evaluated …. .collect( Collectors.toList() );  Finally evaluate
  • 12. Sample Code (Run com.hidetomo.Java8StreamBench.main) https://github.com/mocchidesu/Java8sample.git Input: 100,000 last name from HSA Do: Filter: Last name start with ‘m’ Map: (Brace each name with [] bracket) Sort: Reverse order Dedupe Limit to top 2 results Loop 1000 times. Traditional Java7 For Loop approach vs. Sequential Lambda vs. Parallel Lambda. -> IntelliJ13
  • 13.  Java 8 is backward compatible in binary level  Lambda is not only a syntax sugar  It’s a new era of Java  Performance gain?Will be improved. Stay tuned.  When use? NOW
  • 14. Everything about Java 8 http://www.techempower.com/blog/2013/03/26/everything-about-java-8/ Oracle Compatibility Guide for JDK 8 http://www.oracle.com/technetwork/java/javase/8-compatibility-guide- 2156366.html Lambda Peek under the Hood by Brian Goetz - Java One 2013 http://www.slideshare.net/jaxlondon2012/lambda-a-peek-under-the-hood-brian- goetz 10 Example of Lambda Expressions and Streams in Java 8 http://javarevisited.blogspot.com/2014/02/10-example-of-lambda-expressions-in- java8.html