Why Java is StillImportant?What is new in Java 8S. Shyam SundarArchitect
Agenda1   Introduction2   Why is Java still relevant3   What is new in the Java 8 Language4   What is new in the JVM5   Q/A
The Java Platform       Source: http://www.tbray.org/ongoing/When/200x/2008/08/05/Annotated-OSCON-Keynote
Why is Java still relevant?
Why is Java still relevant? Popular        TIOBE Programming Language Index            http://www.tiobe.com/index.php/cont...
Why is Java still relevant? Popular    # of projects on                 https://github.com/languages
Why is Java still relevant? Popular  # of questions by tags on                  http://stackoverflow.com/tags
Why is Java still relevant? Popular   # of questions in stackoverflow.com                                                 ...
Why is Java still relevant? Batteries included
Why is Java still relevant? Android    Android constitutes >70% of the handheld market
Why is Java still relevant? JVM    BYOP – Bring your own Programming Language
Why is Java still relevant?• A rich ecosystem of libraries, frameworks and tools  (batteries included)• Android (mobile an...
What is new in Java 8
What is new in Java 8• The use of lambda expressions (closures,  Moores Law, simplifying concurrent  programming)• Method ...
What is new in Java 8 - LambdaFileFilter filter = new FileFilter() {   @Override   public boolean accept(File pathname) { ...
What is new in Java 8 – Method referencesclass Person {                             List<Person> people = Arrays.asList(  ...
What is new in Java 8 – Default methods interface Shape {                       interface Shape {   double getWidth();    ...
What is new in the JVM
What is new in JVM• Convergence of the Hotspot and the JRockIt• PermGen gives way to Metaspaces (JEP 122)• Profiles ~ Java...
Thank You
Upcoming SlideShare
Loading in …5
×

Why is Java relevant? New features of Java8

953 views

Published on

Presentation slides from ISDC2013 held on 16-mar-2013

http://www.siliconindia.com/events-overview/India--Software-Developer-Conference-Bangalore-ISDC_2013Blr.html

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
953
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Why is Java relevant? New features of Java8

  1. 1. Why Java is StillImportant?What is new in Java 8S. Shyam SundarArchitect
  2. 2. Agenda1 Introduction2 Why is Java still relevant3 What is new in the Java 8 Language4 What is new in the JVM5 Q/A
  3. 3. The Java Platform Source: http://www.tbray.org/ongoing/When/200x/2008/08/05/Annotated-OSCON-Keynote
  4. 4. Why is Java still relevant?
  5. 5. Why is Java still relevant? Popular TIOBE Programming Language Index http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
  6. 6. Why is Java still relevant? Popular # of projects on https://github.com/languages
  7. 7. Why is Java still relevant? Popular # of questions by tags on http://stackoverflow.com/tags
  8. 8. Why is Java still relevant? Popular # of questions in stackoverflow.com # of github projects http://redmonk.com/sogrady/2013/02/28/language-rankings-1-13/
  9. 9. Why is Java still relevant? Batteries included
  10. 10. Why is Java still relevant? Android Android constitutes >70% of the handheld market
  11. 11. Why is Java still relevant? JVM BYOP – Bring your own Programming Language
  12. 12. Why is Java still relevant?• A rich ecosystem of libraries, frameworks and tools (batteries included)• Android (mobile and handhelds)• The JVM (WORA, support for other languages also)• Massive installed base• Still one of the most popular languages around for enterprise development• Open Source (Community JCP/JEP)• Backed by some of the biggest technology companies (IBM, Google, Apache, RedHat)
  13. 13. What is new in Java 8
  14. 14. What is new in Java 8• The use of lambda expressions (closures, Moores Law, simplifying concurrent programming)• Method references• Default methods (monkey patching? Not really)• New Time API (JSR 310) (age calculation finally becomes a one liner!! ) System.out.println("age is " + Period.between(LocalDate.of(1980, 1, 1), LocalDate.now()).getYears());
  15. 15. What is new in Java 8 - LambdaFileFilter filter = new FileFilter() { @Override public boolean accept(File pathname) { return pathname.getName().endsWith(".java"); }}; for ( File f : new File(".")for ( File f : .listFiles( x -> new File(".").listFiles(filter) ) { x.getName().endsWith(".java")) ) { System.out.println(f); System.out.println(f);} }$ java -versionjava version "1.6.0_41"Java(TM) SE Runtime Environment (build 1.6.0_41-b02-445-11M4107)Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01-445, mixed mode)$ javac Test.java$ java Test./Test.java./Test8.java$ $J8_HOME/bin/java -versionjava version "1.8.0-ea"Java(TM) SE Runtime Environment (build 1.8.0-ea-b79)Java HotSpot(TM) 64-Bit Server VM (build 25.0-b20, mixed mode)$ $J8_HOME/bin/javac Test8.java$ $J8_HOME/bin/java Test8./Test.java./Test8.java
  16. 16. What is new in Java 8 – Method referencesclass Person { List<Person> people = Arrays.asList( private final String name; new Person(20, "Jack"), private final int age; new Person(42, "Bill"), new Person(22, "Jill") Person(int a, String n) { ); name = n; Collections.sort(people, age = a; Person::compareByAge); } System.out.println(people); public static int compareByAge( Collections.sort(people, Person a, Person b) { Person::compareByName); return a.age - b.age; System.out.println(people); } public static int compareByName( Person a, Person b) { $ $J8_HOME/bin/javac MethodRef.java return a.name.compareTo(b.name); $ $J8_HOME/bin/java MethodRef } [Jack age 20, Jill age 22, Bill age 42] @Override [Bill age 42, Jack age 20, Jill age 22] public String toString() { return name + " age " + age; }}
  17. 17. What is new in Java 8 – Default methods interface Shape { interface Shape { double getWidth(); double getWidth(); double getHeight(); double getHeight(); } default double area() { return getWidth() * getHeight(); class Rectangle implements Shape { } } double width, height; Rectangle(double w, double h) { width = w; height = h; Default methods allow us } @Override public double getWidth() { specify default behaviour } return width; without having to introduce abstract classes @Override public double getHeight() { return height; } }
  18. 18. What is new in the JVM
  19. 19. What is new in JVM• Convergence of the Hotspot and the JRockIt• PermGen gives way to Metaspaces (JEP 122)• Profiles ~ Java ME -> Java SE• Reduce HotSpot’s class metadata memory footprint• More compact and efficient Nashorn Javascript engine
  20. 20. Thank You

×