Your SlideShare is downloading. ×
Why is Java relevant? New features of Java8
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Why is Java relevant? New features of Java8

721
views

Published on

Presentation slides from ISDC2013 held on 16-mar-2013 …

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
721
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Why Java is StillImportant?What is new in Java 8S. Shyam SundarArchitect
  • 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. The Java Platform Source: http://www.tbray.org/ongoing/When/200x/2008/08/05/Annotated-OSCON-Keynote
  • 4. Why is Java still relevant?
  • 5. Why is Java still relevant? Popular TIOBE Programming Language Index http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
  • 6. Why is Java still relevant? Popular # of projects on https://github.com/languages
  • 7. Why is Java still relevant? Popular # of questions by tags on http://stackoverflow.com/tags
  • 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. Why is Java still relevant? Batteries included
  • 10. Why is Java still relevant? Android Android constitutes >70% of the handheld market
  • 11. Why is Java still relevant? JVM BYOP – Bring your own Programming Language
  • 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. What is new in Java 8
  • 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. 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. 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. 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. What is new in the JVM
  • 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. Thank You

×