11 Java 7

258 views

Published on

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
258
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

11 Java 7

  1. 1. WELCOME TO JAVA 7 Talk 11
  2. 2. JAVA 7 • Released in July 2011. • No binary compatibility with Java 6. • We are now at 1.7.0_u45. • Support for Java 6 ended in February 2013. • BlackBox 0.14 will be compiled on Java 7.
  3. 3. NEW LANGUAGE FEATURES Project Coin http://radar.oreilly.com/2011/09/java7-features.html
  4. 4. DIAMOND OPERATOR Map<String, List<Trade>> trades = new TreeMap<>();!
  5. 5. STRINGS IN SWITCH String status;! ...! ! switch (status) {! case “new”:! newTrade(t);! break;! case “execute”:! executeTrade(t);! break;! case “pending”:! pendingTrade(t);! }
  6. 6. AUTOMATIC RESOURCE MANAGEMENT try (FileOutputStream fos = new FileOutputStream("movies.txt");! DataOutputStream dos = new DataOutputStream(fos)) {! dos.writeUTF("Java 7 Block Buster");! } catch (IOException e) {! // log the exception! }
  7. 7. MULTICATCH try {! methodThatThrowsThreeExceptions();! } catch (ExceptionOne | ExceptionTwo | ExceptionThree e) {! // log and deal with all Exceptions! }
  8. 8. OTHER LAGUAGE IMPROVEMENTS • Numeric • Binary literals: 1_234_567! literals: 0b1001001011
  9. 9. OTHER IMPROVEMENTS • InvokeDynamic Nashorn) • Unicode • NIO 6.0 2 • JDBC 4.1 bytecode (good for Groovy, JRuby, Project
  10. 10. DELAYED TO JAVA 8 • Modularization • Annotations • Project on Java types Lambda • Swing Application • Project Framework Nashorn (Javascript on the JVM)

×