Java8 新特性

Java8 new features
Java Language Specifioon
  • Lamada Expression

enable you to treat functionality as a method argument, or code as data.

and express interface with one-method more compactly

  • Method Reference

provide easy-to-read lambda expressions for methods that already have a name.eg: System.out::println

  • Default method

enable new functionality to be added to the interfaces of libraries which fuck abstract class

  • Repeating Annotations

provide the ability to apply the same annotation type more than once to the same declaration or type use.

  • 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.

  • Improved type inference.
  • Method parameter reflection

Collections
  • Class 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 Collection API,which enables bulk operations on collections,such as

        sequential or parallel map-reduce transformations

  • Performance Improvement for HashMaps with Key Collisions.


Internationalization

  • Unicode Enhancements ,including support for Unicode 6.2.0
  • Adoption of Unicode CLDR Data and the java.locale.providers System property
  • New Calendar and Locale APIS
  • Ability to Install a Custom Resource Bundle as an Extension

Date-Time package

  • a new set of packages that provide a comprehensive date-time model.

Java Mission Control --need to learn

HotSpot

  • HardWare intrinsics 
  • Removal of PermGen
  • Default Methods in the Java Programming Language are supported by the byte code instructions for method invocation

Java XML --JAXP

Concurrency

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

  • 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.

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

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

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

Java.lang And Java.util Packages

  • Parallel Array Sorting

  • Standard Encoding and Decoding Base64

  • Unsigned Arithmetic Support

IO And NIO

  • New SelectorProvider implementation for Solaris based on the Solaris event port mechanism. To use, run with the system property java.nio.channels.spi.Selectorset to the value sun.nio.ch.EventPortSelectorProvider.

  • Decrease in the size of the <JDK_HOME>/jre/lib/charsets.jar file

  • Performance improvement for the java.lang.String(byte[], *) constructor and thejava.lang.String.getBytes() method.

 

 

   

 
原文地址:https://www.cnblogs.com/fight-tao/p/4907557.html