SlideShare ist ein Scribd-Unternehmen logo
Java 7 Tomasz Wróbel
Schedule ,[object Object],[object Object],[object Object],[object Object],[object Object]
Project Coin ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Binary literals ,[object Object],[object Object],[object Object]
Underscores in Numeric Literals ,[object Object],[object Object],[object Object]
Type Inference for Generic Instance Creation ,[object Object],[object Object]
Catching Multiple Exception Types ,[object Object],[object Object],[object Object],[object Object],[object Object]
twr - The try-with-resources Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
NIO.2 ,[object Object],[object Object],[object Object],[object Object],[object Object]
java.nio.file.Files
java.nio.file.WatchService ,[object Object],[object Object],[object Object]
JSR 292 - Support for dynamically-typed languages ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
invokedynamic ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Method handles ,[object Object],[object Object],[object Object],[object Object],[object Object]
Other benefits of JSR 292 ,[object Object]
A lightweight fork/join framework ,[object Object],[object Object],[object Object],[object Object],[object Object]
New Classes, Interfaces and Enums ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
URLClassLoader.close() ,[object Object]
Beyond ,[object Object],[object Object],[object Object],[object Object]
Resources ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

Building High-Performance Language Implementations With Low Effort
Building High-Performance Language Implementations With Low EffortBuilding High-Performance Language Implementations With Low Effort
Building High-Performance Language Implementations With Low Effort
Stefan Marr
 
Advanced Java Practical File
Advanced Java Practical FileAdvanced Java Practical File
Advanced Java Practical File
Soumya Behera
 
Concurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STM
Concurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STMConcurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STM
Concurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STM
Mario Fusco
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
Rana Ali
 
Java%20 new%20faq.doc 0
Java%20 new%20faq.doc 0Java%20 new%20faq.doc 0
Java%20 new%20faq.doc 0
aravind_aashu
 

Was ist angesagt? (20)

Building High-Performance Language Implementations With Low Effort
Building High-Performance Language Implementations With Low EffortBuilding High-Performance Language Implementations With Low Effort
Building High-Performance Language Implementations With Low Effort
 
Advanced Java Practical File
Advanced Java Practical FileAdvanced Java Practical File
Advanced Java Practical File
 
Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...
Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...
Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...
 
C++11 - STL Additions
C++11 - STL AdditionsC++11 - STL Additions
C++11 - STL Additions
 
Java Basics - Part2
Java Basics - Part2Java Basics - Part2
Java Basics - Part2
 
Advanced Java - Praticals
Advanced Java - PraticalsAdvanced Java - Praticals
Advanced Java - Praticals
 
Deuce STM - CMP'09
Deuce STM - CMP'09Deuce STM - CMP'09
Deuce STM - CMP'09
 
Java Concurrency Idioms
Java Concurrency IdiomsJava Concurrency Idioms
Java Concurrency Idioms
 
How and why I turned my old Java projects into a first-class serverless compo...
How and why I turned my old Java projects into a first-class serverless compo...How and why I turned my old Java projects into a first-class serverless compo...
How and why I turned my old Java projects into a first-class serverless compo...
 
SECURITY ENHANCED KEY PREDISTRIBUTION SCHEME USING TRANSVERSAL DESIGNS AND RE...
SECURITY ENHANCED KEY PREDISTRIBUTION SCHEME USING TRANSVERSAL DESIGNS AND RE...SECURITY ENHANCED KEY PREDISTRIBUTION SCHEME USING TRANSVERSAL DESIGNS AND RE...
SECURITY ENHANCED KEY PREDISTRIBUTION SCHEME USING TRANSVERSAL DESIGNS AND RE...
 
2. Design patterns. part #2
2. Design patterns. part #22. Design patterns. part #2
2. Design patterns. part #2
 
Concurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STM
Concurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STMConcurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STM
Concurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STM
 
Map-Reduce and Apache Hadoop
Map-Reduce and Apache HadoopMap-Reduce and Apache Hadoop
Map-Reduce and Apache Hadoop
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
 
Encapsulation
EncapsulationEncapsulation
Encapsulation
 
Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central Dispatch
 
Session-Based Recommendations with Recurrent Neural Networks (Balazs Hidasi, ...
Session-Based Recommendations with Recurrent Neural Networks(Balazs Hidasi, ...Session-Based Recommendations with Recurrent Neural Networks(Balazs Hidasi, ...
Session-Based Recommendations with Recurrent Neural Networks (Balazs Hidasi, ...
 
Java%20 new%20faq.doc 0
Java%20 new%20faq.doc 0Java%20 new%20faq.doc 0
Java%20 new%20faq.doc 0
 
Боремся с NPE вместе с Kotlin, Павел Шацких СберТех
Боремся с NPE вместе с Kotlin, Павел Шацких СберТехБоремся с NPE вместе с Kotlin, Павел Шацких СберТех
Боремся с NPE вместе с Kotlin, Павел Шацких СберТех
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John Stevenson
 

Ähnlich wie Java 7

Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, TuningJava 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Carol McDonald
 
Java 7 & 8 - A&BP CC
Java 7 & 8 - A&BP CCJava 7 & 8 - A&BP CC
Java 7 & 8 - A&BP CC
JWORKS powered by Ordina
 
Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011
Agora Group
 
Java 7 & 8
Java 7 & 8Java 7 & 8
Java 7 & 8
Ken Coenen
 

Ähnlich wie Java 7 (20)

Java one 2010
Java one 2010Java one 2010
Java one 2010
 
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
 
Java 17
Java 17Java 17
Java 17
 
.NET Vs J2EE
.NET Vs J2EE.NET Vs J2EE
.NET Vs J2EE
 
Java quickref
Java quickrefJava quickref
Java quickref
 
Java 7: Quo vadis?
Java 7: Quo vadis?Java 7: Quo vadis?
Java 7: Quo vadis?
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
Learning to Spot and Refactor Inconsistent Method Names
Learning to Spot and Refactor Inconsistent Method NamesLearning to Spot and Refactor Inconsistent Method Names
Learning to Spot and Refactor Inconsistent Method Names
 
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, TuningJava 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
 
A Survey of Concurrency Constructs
A Survey of Concurrency ConstructsA Survey of Concurrency Constructs
A Survey of Concurrency Constructs
 
Java 7 & 8 - A&BP CC
Java 7 & 8 - A&BP CCJava 7 & 8 - A&BP CC
Java 7 & 8 - A&BP CC
 
Ice mini guide
Ice mini guideIce mini guide
Ice mini guide
 
New Features Of JDK 7
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7
 
Java 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin NakovJava 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin Nakov
 
Java se7 features
Java se7 featuresJava se7 features
Java se7 features
 
Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011
 
From Java 6 to Java 7 reference
From Java 6 to Java 7 referenceFrom Java 6 to Java 7 reference
From Java 6 to Java 7 reference
 
Java 7 & 8
Java 7 & 8Java 7 & 8
Java 7 & 8
 
SystemVerilog-20041201165354.ppt
SystemVerilog-20041201165354.pptSystemVerilog-20041201165354.ppt
SystemVerilog-20041201165354.ppt
 
Data Types/Structures in DivConq
Data Types/Structures in DivConqData Types/Structures in DivConq
Data Types/Structures in DivConq
 

Kürzlich hochgeladen

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Kürzlich hochgeladen (20)

Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 

Java 7

Hinweis der Redaktion

  1. Hi, I would like to highlight what's coming in Java 7. Java 7 has codename Dolphin. That's the longest release ever. It was eventually split into two parts. And the second part will become Java 8.
  2. Java 6 was release in December 2006. It took 4 years to meet feature complete release. That's where list of features is closed. Last scheduled milestone is in June. By then all bugs should be fixed. And Java 7 should be generally available in late July.
  3. The goal of Project Coin was to determine what set of small language changes should be added to JDK 7. There was an open call for proposals that ran in March 2009. Out of nearly 70 proposal few were chosen. Strings in switch statements described here if time allows.
  4. In Java 7 the integral types can also be expressed using the binary number system. To specify a binary literal, add the prefix 0b or 0B to the number. I already see people using it during interviews :)
  5. In Java 7 any number of underscore characters (_) can appear anywhere between digits in a numerical literal. This feature enables you, for example, to separate groups of digits in numeric literals, which can improve the readability of your code. Think of a credit card or telephone number.
  6. In Java 7 you can replace the type arguments required to invoke the constructor of a generic class with an empty set of type parameters (<>). However this will only be possible if compiler can infer the type arguments from the context. This pair of angle brackets is informally called the diamond operator. It will certainly reduce the noise in the Java code.
  7. In Java 7 and later, a single catch block can handle more than one type of exception. This feature can reduce code duplication and lessen the temptation to catch an overly broad exception.
  8. The try-with-resources statement is a try statement that declares one or more resources. And a resource is as an object that must be closed after the program is finished with it. The try-with-resources statement ensures that each resource is closed at the end of the statement. Any object that implements new AutoCloseable interface can be used as a resource. There are 50 interfaces extending AutoCloseable interface - important ones are Connection , ResultSet and Statement (as part of JDBC 4.1) There are over 100 classes implementing AutoCloseable interface - all kind of Streams
  9. In Java 7 we will know not only about files and directories but also about symbolic links, file attributes, permissions, owner, etc. The Path is a main class and has methods for manipulating a path in the filesystem. The FileSystem class has a variety of methods for obtaining information about the file system. Java 7 brings a fully-functional filesystem provider for zip and jar archives, which you will be able to treat as files system. A Path also defines the resolve and resolveSibling methods to combine paths. The relativize method that can be used to construct a relative path between two paths. Paths can be compared, and tested against each other using the startsWith and endWith methods.
  10. The Files class has methods for file operations, such as move, copy, delete, and also methods for retrieving and setting file attributes. This class offers also a rich set of static methods for reading, writing, and manipulating files and directories. Several Files methods, such as move, can perform certain operations atomically in some file systems. An atomic file operation is an operation that cannot be interrupted or "partially" performed.
  11. A WatchService was introduced that watches registered objects for changes and events. You may use a watch service to monitor a directory for changes to be able to update UI when files are created or deleted. The main goal here was to help with performance issues in applications that previously were forced to poll the file system.
  12. Bit of a background. There are two parts of Java really: Java, the language and Java Virtual Machine, so called JVM. Java code is translate or compiled into bytecode that is executed on JVM. There are lots of other languages that can be compiled to bytecode (like Ruby in form of a JRuby). However due to nature of dynamic languages people needed to use workaround or hacks to generate a bytecode and this resulted in worse performance.
  13. In JDK 7, dynamically typed languages should run faster in the JVM than they do today. A key part of support for this is the addition of a new Java bytecode instruction invokedynamic , for method invocation, and an accompanying linkage mechanism that involves a new construct called a method handle.
  14. In summary, method handles provide the linkage mechanism that enables the JVM to invoke the correct method in response to an invokedynamic bytecode instruction. When the JVM sees an invokedynamic bytecode, it uses method handles to get to the method it needs. In a way it could be used for things Java Reflection API was used so far. However, compared to using the Reflection API, access checking is performed when the method handle is created as opposed to every time the method is called, thus is faster.
  15. Although JSR-292 was intended to help dynamically typed languages it will bring huge benefits in other areas. There is a Oracle employee blogging on these other goodies. One of them is that code coverage tools will get faster. Record a visit in a bootstrap method and use method handle to no-op method. Java Specfication Request (JSR)
  16. There are few concurrency updates in Java 7. New is the fork/join framework that helps you take advantage of multiple processors. It is designed for work that can be broken into smaller pieces recursively. This is a style of parallel programming in which problems are solved by splitting them into subtasks that are solved in parallel, waiting for them to complete, and then composing results. Fork/Join framework was intended to be included in the JDK 5, but finally did not make it.
  17. As always there are numerous additions to JAVA API. They are mostly related to changes mentioned earlier, but there are also some utility methods added that might be useful, like Objects class. j ava.util.Objects boolean equals(Object a, Object b) boolean deepEquals(Object a, Object b) int hashCode(Object o) int hash(Object... values) String toString(Object o) String toString(Object o, String nullDefault) <T> int compare(T a, T b, Comparator<? super T> c) <T> T requireNonNull(T obj) <T> T requireNonNull(T obj, String message)
  18. Java 7 adds a close() method to URLClassLoader. This is a methods that frees the underlying resources, such as open files, held by a URLClassLoader. It is a particular problem on Windows, because open files cannot be deleted or replaced.
  19. Leftover from JAVA 7 Lambda expressions are anonymous functions A lot of current API requiring interface with only one method will be much easier to use. The other bit, Project Jigsaw, aims to modularize JDK, split it into smaller parts, provide profiles and download what's necessary as you go.