SlideShare a Scribd company logo
1 of 29
Download to read offline
20 years of Java
&
Simplified PARALLELISM - Java8
AGENDA
20 Years of JAVA
✣ Prehistory - the WEB
✣ Birth of OAK or JAVA
✣ Evolution till date
++++++++++++++++
Fun Quiz
Java 8 - Streams API and Parallelism
✣ Lambdas
✣ Streams
✣ Parallel Streams
++++++++++++++++
Demo Q&A
Slides will be uploaded at http://www.slideshare.net/dshevani
Hello everyone !
I am Deepak Shevani
I work at Flipkart, building next generation e-commerce platforms.
I like presenting & love to mingle with technology enthusiasts.
Contact me : aum2deepak@gmail.com
@deepak_shevani
1.
Evolution of JAVA
(1995-2015)
Community of 9 million developers
Powering 7 billion devices
Prehistory
✣ [1991]
■ World Wide Web initially released by CERN for physics community
■ Project Green started at Sun to explore opportunities in consumer electronics
■ New Wave was about convergence of interconnected computers and devices
■ James Gosling was exploring programming languages to suit requirements
✣ [1992]
■ OAK programming language, descendant of C++ but platform independent
■ Star7 interactive hand-held PDA introduced by Project Green
✣ [1993]
■ World Wide Web is born at CERN, put on public domain
■ 500 known web servers around the world
✣ [1994]
■ Browsers : Netscape Navigator released, WebRunner (HotJava)* demoed
■ 10,000 known web servers and 10 million web users
■ Java compiler re-written in Java rather in C++
Birth OF JAVA [1995]
✣ 16 million internet users worldwide
✣ Birth of e-Commerce companies
■ __a___ and __a_
✣ Birth of internet companies
■ _a___
✣ Demo of WebRunner at TED conference
✣ Debut of
■ Java 1.0a2
■ Hotjava
H A P P Y B I R T H D A Y J A V A
Birth OF JAVA [1995]
✣ 16 million internet users worldwide
✣ Birth of e-Commerce companies
■ Amazon and eBay
✣ Birth of internet companies
■ Yahoo
✣ Demo of WebRunner demo at TED
✣ Debut of
■ Java 1.0a2
■ Hotjava
H A P P Y B I R T H D A Y J A V A
Evolution OF JAVA [1996-2000]
✣ [1996]
■ First JavaOne developer conference held in SFO and attracts 6000 people
■ Java 1.0 available for download
■ Sun licenses Java to OS vendors including MS, Apple, IBM and others
✣ [1997]
■ JDK 1.1 released, included JavaBeans, RMI, JIT, Inner Classse, JDBC support
■ Sun sues Microsoft over use of Java and distorting it :)
■ 43% of US families own a computer
✣ [1998]
■ Google :) Apple iMac :)
■ Netscape Navigator acquired by AOL for whopping $4.2 billion
■ JDK 1.2 released, included Swing, Plugin, IDL, Collections, strictfp
✣ [1999]
■ Sun and AOL announce a joint alliance to market business software
■ Sun announces Java 2 Platform, J2ME, J2SE and J2EE
✣ [2000]
■ DotCom bubble bursts
■ JDK 1.3 released, included HotSpot, RMI/Corba, Java Sound
Evolution OF JAVA [2001-2005]
✣ [2001]
■ Google awarded patent for pagerank algorithm
■ Launch of Eclipse Project by IBM
■ Apple iPod :)
✣ [2002]
■ JDK 1.4 released, included JCP, WebStart, NIO, Logging, assertions
■ J2EE SDK downloads reach 2 million
✣ [2003]
■ Java’s new coffee logo debuts
■ Java.com launches
✣ [2004]
■ Java technology powered Mars Rover (Spirit) touches Mars
■ Java is already on 1.5 billion devices
■ Java 2 Platform Standard Edition J2SE 5.0 (Project Tiger) released
■ Included Generics, AutoBoxing/UnBoxing, Concurrency Utilities, enums
✣ [2005]
■ Google Maps launched
■ Sun launches Glassfish product
Evolution OF JAVA [2006-2010]
✣ [2006]
■ Java SE 6 released (no longer branded as J2SE) (Project Mustang)
■ Included Scripting, XML and Web Services
■ Sun releases Java Platforms on Oct 25 under the GNU General Public License
:)
✣ [2007]
■ Apple iPhone :)
■ Sun releases Duke, the Java mascot, under the free BSD license
✣ [2008]
■ Google introduces the Android operating system for mobile phones.
■ Facebook reaches 100 million users.
■ Twitter.com has more than 70 million unique visitors per month.
■ Sun slowing down ??
✣ [2009]
■ Oracle announces that it will acquire Sun Microsystems at JavaOne
■ Project Coin launched to enhance the Java programming language
✣ [2010]
■ Oracle acquires Sun Microsystems
■ JCP approves Java 7 and Java 8 roadmaps
Evolution OF JAVA [2011-2015]
✣ [2011]
■ Java SE 7 released (Project Dolphin) on July 28, 2011
■ Features
○ Strings in Switch statement
○ Type Inference for Generic Instance Creation
○ Multiple Exception Handling
○ Diamond Syntax
○ Automatic null Handling
○ ForkJoin, NIO2
○ etc
✣ [2014]
■ Java SE 8 released (No Project code !! ) on March 18, 2014
■ Features
○ Lambda Expressions, Streams
○ Pipelines and Streams API
○ Default Methods
○ Nashorn Javascript engine
○ Parallel operations
○ etc
QUIZ TIME
1) When did Java go open-source ? (date-year)
QUIZ TIME
1) When did Java go open-source ? (date-year)
Oct 25, 2006
QUIZ TIME
1) When did Java go open-source ? (date-year)
Oct 25, 2006
2) When was internet first put on public domain ?
QUIZ TIME
1) When did Java go open-source ? (date-year)
Oct 25, 2006
2) When was internet first put on public domain ?
1993
QUIZ TIME
1) When did Java go open-source ? (date-year)
Oct 25, 2006
2) When was internet first put on public domain ?
1993
3) When was Java Coffee logo introduced ?
QUIZ TIME
1) When did Java go open-source ? (date-year)
Oct 25, 2006
2) When was internet first put on public domain ?
1993
3) When was Java Coffee logo introduced ?
2003
GREAT - Let’s move on :)
Parallel STREAMS
No more boilerplate code !!
Basic Jargon FIRST
Lambdas
A lambda is anonymous function. A function is a
computation that may take some arguments and
may return some value. Lambdas enable functions to
passed around and stored like values (smells like
functional programming, yeah)
Syntax of lambda expression
( [optional arguments] ) -> body
( Person p1, Person p2 ) -> p1.name() == p2.name()
**** Types can be inferred (parameters, return type)
Streams
A Stream is an abstract concept that represents
multiple values. It may or may not be collection.
It may or may not be a sequence. It may or may
not be an iterator. It is something that would
allow sequential as well as parallel processing :)
Stream<T> is opened using
Collections.stream(), Collection.parallelStream()
IntStream.range(), Stream.of(), Arrays.stream()
BufferedReader.lines(), CharSequence.chars()
E X A M P L E S H O U L D M A K E I T C L E A R
SomeList<Employee> employees = ….
double highestPaid =
employees.stream()
.filter(e -> e.getDepartment().equals(‘Search’)
.map(e -> e.getSalary())
.max();
I T E R A T I O N S
// EXTERNAL
for (Item items : items) {
process(item);
}
// INTERNAL
items.forEach(item -> process(item));
S T R E A M O F B E N E F I T S
- LAZY EVALUATION
- SHORT CIRCUITING
- AUTOMATIC PARALLELISM
DEMO TIME
Question
Find all transactions of type mobiles and return a
list of transaction IDs sorted in decreasing order of
transaction value.
W I T H O U T S T R E A M S ( Java 7)
List mobileTransactions = new Arraylist<>();
for(Transaction t: transactions){
if(t.getType() == Transaction.MOBILE){
mobileTransactions.add(t);
}
}
Collections.sort(mobileTransactions, new MobilesComparator());
List transactionIds = new ArrayList<>();
for(Transaction t: mobileTransactions){
transactionsIds.add(t.getId());
}
U S I N G S T R E A M S ( Java 8)
List transactionsIds = transactions.stream()
.filter(t -> t.getType() == Transaction.MOBILE)
.sorted(comparing(Transaction::getValue)
.reversed())
.map(Transaction::getId)
.collect(toList());
U S I N G P A R A L L E L S T R E A M S
List transactionsIds = transactions.parallelStream()
.filter(t -> t.getType() == Transaction.MOBILE)
.sorted(comparing(Transaction::getValue)
.reversed())
.map(Transaction::getId)
.collect(toList());
Credits
Special thanks to all the people who made and
released these awesome resources for free:
✣ Presentation template by SlidesCarnival
✣ Photographs by Unsplash
✣ Paper texture by GraphicBurguer
That’s IT FOLKS
Thanks for being
SUCH a WONDERFUL AUDIENCE

More Related Content

Similar to Java 8-streams-and-parallelism

EmergingTrendsInComputingAndProgrammingLanguages
EmergingTrendsInComputingAndProgrammingLanguagesEmergingTrendsInComputingAndProgrammingLanguages
EmergingTrendsInComputingAndProgrammingLanguagesDeepak Shevani
 
Eclipse IoT Talk (Montreal JUG)
Eclipse IoT Talk (Montreal JUG)Eclipse IoT Talk (Montreal JUG)
Eclipse IoT Talk (Montreal JUG)Mike Milinkovich
 
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)Java World, Java Trends, Java 8 and Beyond (iForum - 2014)
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)Olena Syrota
 
From Java to Ruby...and Back
From Java to Ruby...and BackFrom Java to Ruby...and Back
From Java to Ruby...and BackAnil Hemrajani
 
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...cresco
 
Web application development - The past, the present, the future
Web application development - The past, the present, the futureWeb application development - The past, the present, the future
Web application development - The past, the present, the futureJuho Vepsäläinen
 
what is java.pdf
what is java.pdfwhat is java.pdf
what is java.pdfXanGwaps
 
Join the Java Evolution Portland Oregon
Join the Java Evolution Portland OregonJoin the Java Evolution Portland Oregon
Join the Java Evolution Portland OregonHeather VanCura
 
Trends and future of java
Trends and future of javaTrends and future of java
Trends and future of javaCsaba Toth
 

Similar to Java 8-streams-and-parallelism (20)

EmergingTrendsInComputingAndProgrammingLanguages
EmergingTrendsInComputingAndProgrammingLanguagesEmergingTrendsInComputingAndProgrammingLanguages
EmergingTrendsInComputingAndProgrammingLanguages
 
Eclipse IoT Talk (Montreal JUG)
Eclipse IoT Talk (Montreal JUG)Eclipse IoT Talk (Montreal JUG)
Eclipse IoT Talk (Montreal JUG)
 
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)Java World, Java Trends, Java 8 and Beyond (iForum - 2014)
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)
 
From Java to Ruby...and Back
From Java to Ruby...and BackFrom Java to Ruby...and Back
From Java to Ruby...and Back
 
Tech
TechTech
Tech
 
Scala Introduction
Scala IntroductionScala Introduction
Scala Introduction
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
 
Web application development - The past, the present, the future
Web application development - The past, the present, the futureWeb application development - The past, the present, the future
Web application development - The past, the present, the future
 
what is java.pdf
what is java.pdfwhat is java.pdf
what is java.pdf
 
Java8 launch AMIS Services by Lucas Jellema
Java8 launch AMIS Services by Lucas Jellema Java8 launch AMIS Services by Lucas Jellema
Java8 launch AMIS Services by Lucas Jellema
 
Join the Java Evolution Portland Oregon
Join the Java Evolution Portland OregonJoin the Java Evolution Portland Oregon
Join the Java Evolution Portland Oregon
 
Java basics
Java basicsJava basics
Java basics
 
Introduction of java
Introduction  of javaIntroduction  of java
Introduction of java
 
Trends and future of java
Trends and future of javaTrends and future of java
Trends and future of java
 

Recently uploaded

S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086anil_gaur
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projectssmsksolar
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 

Recently uploaded (20)

FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 

Java 8-streams-and-parallelism

  • 1. 20 years of Java & Simplified PARALLELISM - Java8
  • 2. AGENDA 20 Years of JAVA ✣ Prehistory - the WEB ✣ Birth of OAK or JAVA ✣ Evolution till date ++++++++++++++++ Fun Quiz Java 8 - Streams API and Parallelism ✣ Lambdas ✣ Streams ✣ Parallel Streams ++++++++++++++++ Demo Q&A Slides will be uploaded at http://www.slideshare.net/dshevani
  • 3. Hello everyone ! I am Deepak Shevani I work at Flipkart, building next generation e-commerce platforms. I like presenting & love to mingle with technology enthusiasts. Contact me : aum2deepak@gmail.com @deepak_shevani
  • 4. 1. Evolution of JAVA (1995-2015) Community of 9 million developers Powering 7 billion devices
  • 5. Prehistory ✣ [1991] ■ World Wide Web initially released by CERN for physics community ■ Project Green started at Sun to explore opportunities in consumer electronics ■ New Wave was about convergence of interconnected computers and devices ■ James Gosling was exploring programming languages to suit requirements ✣ [1992] ■ OAK programming language, descendant of C++ but platform independent ■ Star7 interactive hand-held PDA introduced by Project Green ✣ [1993] ■ World Wide Web is born at CERN, put on public domain ■ 500 known web servers around the world ✣ [1994] ■ Browsers : Netscape Navigator released, WebRunner (HotJava)* demoed ■ 10,000 known web servers and 10 million web users ■ Java compiler re-written in Java rather in C++
  • 6. Birth OF JAVA [1995] ✣ 16 million internet users worldwide ✣ Birth of e-Commerce companies ■ __a___ and __a_ ✣ Birth of internet companies ■ _a___ ✣ Demo of WebRunner at TED conference ✣ Debut of ■ Java 1.0a2 ■ Hotjava H A P P Y B I R T H D A Y J A V A
  • 7. Birth OF JAVA [1995] ✣ 16 million internet users worldwide ✣ Birth of e-Commerce companies ■ Amazon and eBay ✣ Birth of internet companies ■ Yahoo ✣ Demo of WebRunner demo at TED ✣ Debut of ■ Java 1.0a2 ■ Hotjava H A P P Y B I R T H D A Y J A V A
  • 8. Evolution OF JAVA [1996-2000] ✣ [1996] ■ First JavaOne developer conference held in SFO and attracts 6000 people ■ Java 1.0 available for download ■ Sun licenses Java to OS vendors including MS, Apple, IBM and others ✣ [1997] ■ JDK 1.1 released, included JavaBeans, RMI, JIT, Inner Classse, JDBC support ■ Sun sues Microsoft over use of Java and distorting it :) ■ 43% of US families own a computer ✣ [1998] ■ Google :) Apple iMac :) ■ Netscape Navigator acquired by AOL for whopping $4.2 billion ■ JDK 1.2 released, included Swing, Plugin, IDL, Collections, strictfp ✣ [1999] ■ Sun and AOL announce a joint alliance to market business software ■ Sun announces Java 2 Platform, J2ME, J2SE and J2EE ✣ [2000] ■ DotCom bubble bursts ■ JDK 1.3 released, included HotSpot, RMI/Corba, Java Sound
  • 9. Evolution OF JAVA [2001-2005] ✣ [2001] ■ Google awarded patent for pagerank algorithm ■ Launch of Eclipse Project by IBM ■ Apple iPod :) ✣ [2002] ■ JDK 1.4 released, included JCP, WebStart, NIO, Logging, assertions ■ J2EE SDK downloads reach 2 million ✣ [2003] ■ Java’s new coffee logo debuts ■ Java.com launches ✣ [2004] ■ Java technology powered Mars Rover (Spirit) touches Mars ■ Java is already on 1.5 billion devices ■ Java 2 Platform Standard Edition J2SE 5.0 (Project Tiger) released ■ Included Generics, AutoBoxing/UnBoxing, Concurrency Utilities, enums ✣ [2005] ■ Google Maps launched ■ Sun launches Glassfish product
  • 10. Evolution OF JAVA [2006-2010] ✣ [2006] ■ Java SE 6 released (no longer branded as J2SE) (Project Mustang) ■ Included Scripting, XML and Web Services ■ Sun releases Java Platforms on Oct 25 under the GNU General Public License :) ✣ [2007] ■ Apple iPhone :) ■ Sun releases Duke, the Java mascot, under the free BSD license ✣ [2008] ■ Google introduces the Android operating system for mobile phones. ■ Facebook reaches 100 million users. ■ Twitter.com has more than 70 million unique visitors per month. ■ Sun slowing down ?? ✣ [2009] ■ Oracle announces that it will acquire Sun Microsystems at JavaOne ■ Project Coin launched to enhance the Java programming language ✣ [2010] ■ Oracle acquires Sun Microsystems ■ JCP approves Java 7 and Java 8 roadmaps
  • 11. Evolution OF JAVA [2011-2015] ✣ [2011] ■ Java SE 7 released (Project Dolphin) on July 28, 2011 ■ Features ○ Strings in Switch statement ○ Type Inference for Generic Instance Creation ○ Multiple Exception Handling ○ Diamond Syntax ○ Automatic null Handling ○ ForkJoin, NIO2 ○ etc ✣ [2014] ■ Java SE 8 released (No Project code !! ) on March 18, 2014 ■ Features ○ Lambda Expressions, Streams ○ Pipelines and Streams API ○ Default Methods ○ Nashorn Javascript engine ○ Parallel operations ○ etc
  • 12. QUIZ TIME 1) When did Java go open-source ? (date-year)
  • 13. QUIZ TIME 1) When did Java go open-source ? (date-year) Oct 25, 2006
  • 14. QUIZ TIME 1) When did Java go open-source ? (date-year) Oct 25, 2006 2) When was internet first put on public domain ?
  • 15. QUIZ TIME 1) When did Java go open-source ? (date-year) Oct 25, 2006 2) When was internet first put on public domain ? 1993
  • 16. QUIZ TIME 1) When did Java go open-source ? (date-year) Oct 25, 2006 2) When was internet first put on public domain ? 1993 3) When was Java Coffee logo introduced ?
  • 17. QUIZ TIME 1) When did Java go open-source ? (date-year) Oct 25, 2006 2) When was internet first put on public domain ? 1993 3) When was Java Coffee logo introduced ? 2003 GREAT - Let’s move on :)
  • 18. Parallel STREAMS No more boilerplate code !!
  • 19. Basic Jargon FIRST Lambdas A lambda is anonymous function. A function is a computation that may take some arguments and may return some value. Lambdas enable functions to passed around and stored like values (smells like functional programming, yeah) Syntax of lambda expression ( [optional arguments] ) -> body ( Person p1, Person p2 ) -> p1.name() == p2.name() **** Types can be inferred (parameters, return type) Streams A Stream is an abstract concept that represents multiple values. It may or may not be collection. It may or may not be a sequence. It may or may not be an iterator. It is something that would allow sequential as well as parallel processing :) Stream<T> is opened using Collections.stream(), Collection.parallelStream() IntStream.range(), Stream.of(), Arrays.stream() BufferedReader.lines(), CharSequence.chars()
  • 20. E X A M P L E S H O U L D M A K E I T C L E A R SomeList<Employee> employees = …. double highestPaid = employees.stream() .filter(e -> e.getDepartment().equals(‘Search’) .map(e -> e.getSalary()) .max();
  • 21. I T E R A T I O N S // EXTERNAL for (Item items : items) { process(item); } // INTERNAL items.forEach(item -> process(item));
  • 22. S T R E A M O F B E N E F I T S - LAZY EVALUATION - SHORT CIRCUITING - AUTOMATIC PARALLELISM
  • 24. Question Find all transactions of type mobiles and return a list of transaction IDs sorted in decreasing order of transaction value.
  • 25. W I T H O U T S T R E A M S ( Java 7) List mobileTransactions = new Arraylist<>(); for(Transaction t: transactions){ if(t.getType() == Transaction.MOBILE){ mobileTransactions.add(t); } } Collections.sort(mobileTransactions, new MobilesComparator()); List transactionIds = new ArrayList<>(); for(Transaction t: mobileTransactions){ transactionsIds.add(t.getId()); }
  • 26. U S I N G S T R E A M S ( Java 8) List transactionsIds = transactions.stream() .filter(t -> t.getType() == Transaction.MOBILE) .sorted(comparing(Transaction::getValue) .reversed()) .map(Transaction::getId) .collect(toList());
  • 27. U S I N G P A R A L L E L S T R E A M S List transactionsIds = transactions.parallelStream() .filter(t -> t.getType() == Transaction.MOBILE) .sorted(comparing(Transaction::getValue) .reversed()) .map(Transaction::getId) .collect(toList());
  • 28. Credits Special thanks to all the people who made and released these awesome resources for free: ✣ Presentation template by SlidesCarnival ✣ Photographs by Unsplash ✣ Paper texture by GraphicBurguer
  • 29. That’s IT FOLKS Thanks for being SUCH a WONDERFUL AUDIENCE