Thursday, May 1, 2014

Java 8 features

1) Lambda Expressions, a new language feature, has been introduced in this release. They enable you to treat functionality as a method argument, or code as data. Lambda expressions let you express instances of single-method interfaces (referred to as functional interfaces) more compactly.

2) Method references provide easy-to-read lambda expressions for methods that already have a name.

3)Default methods enable new functionality to be added to the interfaces of libraries and ensure binary compatibility with code written for older versions of those interfaces.

4) Repeating Annotations provide the ability to apply the same annotation type more than once to the same declaration or type use.

5) Type Annotations provide the ability to apply an annotation anywhere a type is used, not just on a declaration. Used with a pluggable type system, this feature enables improved type checking of your code.

6) Improved type inference.

7) Method parameter reflection.

8) Classes in the new java.util.stream package provide a Stream API to support functional-style operations on streams of elements. The Stream API is integrated into the Collections API, which enables bulk operations on collections, such as sequential or parallel map-reduce transformations.

9) Performance Improvement for HashMaps with Key Collisions

10) Date-Time Package - a new set of packages that provide a comprehensive date-time model.

Concurrency

11) Classes and interfaces have been added to the java.util.concurrent package.

12 )Methods have been added to the java.util.concurrent.ConcurrentHashMap class to support aggregate operations based on the newly added streams facility and lambda expressions.

13)Classes have been added to the java.util.concurrent.atomic package to support scalable updatable variables.

14) Methods have been added to the java.util.concurrent.ForkJoinPool class to support a common pool.

15) The java.util.concurrent.locks.StampedLock class has been added to provide a capability-based lock with three modes for controlling read/write access.

No comments:

Post a Comment