Wednesday 14 January 2015

Java 8 Features

Java 8 adds Lots of new features in major release. The first time I heard about lambda expressions in Java. This document summarizes features and enhancements in Java SE 8 and in JDK 8, Oracle's implementation of Java SE 8.


Main Features:

1)      Lambda Expressions & Virtual Extension Methods
2)      Reduce Cache Contention on Specified Fields
3)      Remove the Permanent Generation
4)      Retire Some Rarely-Used GC Combinations
5)      Small VM
6)      Launch JavaFX Applications
7)      Generalized Target-Type Inference
8)      Annotations on Java Types
9)      Parallel Array Sorting
10)   Date & Time API
11)   JDBC 4.2
12)   Unicode 6.2
13)   Stronger Algorithms for Password-Based Encryption


1]Lambda Expressions & Virtual Extension Methods:-

Add lambda expressions (closures) and supporting features, including method references, enhanced type inference, and virtual extension methods, to the Java programming language and platform.
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.
(int x, int y) -> x + y
() -> System.out.println(this)
(String str) -> System.out.println(str)
str -> System.out.println(str)
(String s1, String s2) -> { return s2.length() - s1.length(); }
(s1, s2) -> s2.length() - s1.length()

2] Reduce Cache Contention on Specified Fields:-

Define a way to specify that one or more fields in an object are likely to be highly contended across processor cores so that the VM can arrange for them not to share cache lines with other fields, or other objects, that are likely to be independently accessed.

3] Remove the Permanent Generation:-

Remove the permanent generation from the Hotspot JVM and thus the need to tune the size of the permanent generation.

4] Retire Some Rarely-Used GC Combinations:-

Remove three rarely-used combinations of garbage collectors in order to reduce ongoing development, maintenance, and testing costs.

5] Small VM:-

Support the creation of a small VM that is no larger than 3MB.

6] Launch JavaFX Applications:-

Enhance the java command-line launcher to launch JavaFX applications.

7] Generalized Target-Type Inference:-

Smoothly expand the scope of method type-inference to support
(i)inference in method context and (ii) inference in chained calls.

8] Annotations on Java Types:-

Extend the set of annotatable locations in the syntax of the Java programming language to include names which indicate the use of a type as well as (per Java SE 5.0) the declaration of a type.

9] Parallel Array Sorting:-

Add additional utility methods to java.util.Arrays that use the JSR 166 Fork/Join parallelism common pool to provide sorting of arrays in parallel.

10] Date & Time API:-

Define a new date, time, and calendar API for the Java SE platform.

11] JDBC 4.2:-

Changes under consideration for JDBC 4.2 include:
§  Add a generic setter/update method to ResultSet, PreparedStatement, and CallableStatement to support new data types such as those being defined in JSR 310.
§  Define REF_CURSOR support for CallableStatement.
§  Specify required DataSource properties for a Java EE environment.
§  Enhance DatabaseMetaData.getIndexInfo to provide new columns forCARDINALITY and PAGES which return a long value.
§  Add a new DatabaseMeta method to return the logical maximum size for a LOB.
§  Additional clean up of the spec as needed.

12] Unicode 6.2:-

The following were the primary changes in Unicode 6.1.0:
  • add 11 new blocks to java.lang.Character.UnicodeBlock,
  • add 7 new scripts to java.lang.Character.UnicodeScript, and
  • support over 700 new characters in j.l.CharacterString, and other classes.

13] Stronger Algorithms for Password-Based Encryption:-

Provide stronger Password-Based-Encryption (PBE) algorithm implementations in the SunJCE provider.



This is only summary of Main Features and we will discuss details in my Next Post. If you want more information about Java8 then goto  JAVA8 Official Site.

    Categories

    Text Widget

    Followers