Java 8 (Java SE 8) is a major feature release.With Java 8 release, java provided support for
- Functional Programming
- API for Date and Time
- Streaming API, etc..,
New Features in Java 8
Some important features of Java 8 Listed below. We will see more Features in detail in upcoming chapters.
Lambda Expressions 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.
Method references provide easy-to-read lambda expressions for methods that already have a name.Referencing function by their name instead of invoking them directly.Using function as parameter.
Interface to have default method. 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.
New Tools in Java 8
- The jjs command is provided to invoke the Nashorn engine.
- The jdeps command-line tool is provided for analyzing class files.
- Java Management Extensions (JMX) provide remote access to diagnostic commands.
- The jarsigner tool has an option for requesting a signed time stamp from a Time Stamping Authority (TSA).
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.Performance Improvement for HashMaps with Key Collisions
Date Time API
Improved Date Time API.
Ask your questions in eHowToNow Forum
- Java – LongStream Interface
- Java 8 Stream Filter and Collect Example
- Java – BiConsumer Interface
- java.util.function Package
- Java – Supplier Interface
- Java – IntToDoubleFunction Interface
- Java 8 Stream Collectors groupingBy with count and sum Example
- Java – Collector Interface
- Java – DoubleToIntFunction Interface
- Java – Collectors Class
- Java – DoublePredicate Interface
- Java – IntFunction Interface
- Java – IntSupplier Interface
- Java – LongConsumer Interface
- Java 8 Stream Filter with findAny orElse Example