Java 8 was released in March 2014 and it was great a update.
Latest Java 8 version is Java SE 8 Update 181. Oracle decided to overhauled the java with new exciting features and these are :
Release | Release date | Highlights |
---|---|---|
Java SE 8 | 2014-03-18 | Initial release |
Java SE 8 Update 5[252] | 2014-04-15 | Using "*" in Caller-Allowable-Codebase attribute; 11 bug fixes |
Java SE 8 Update 11[253] | 2014-07-15 | Java Dependency Analysis Tool (jdeps); Java Control Panel option to disable sponsors; JAR file attribute – Entry-Point; JAXP processing limit property – maxElementDepth; 18 security bug fixes,[254] 15 bug fixes |
Java SE 8 Update 20[255] | 2014-08-19 | 669 bug fixes,[256] JMC 5.4, String deduplication (disabled by default) |
1. forEach() method in Iterable interface : It is a new way to iterate over the collections (list, set, map etc.)
2. default and static methods in Interfaces : To provide the backward compatibility Java Introduced the default methods and it also help the programmers to add a default implementation of methods which can be shared by the implementing classes.
3. Functional Interfaces and Lambda Expressions : It was the most awaited feature to make the programming clean writing of the code and use of functional interfaces.
4. Java Stream API for Bulk Data Operations on Collections : Bulk data operations are made easy and now processing of the elements can be sequential or parallel.
5. Java Time API : New Design of time and date related functionality to deal with the different time zones in a efficient manner.
6. Collection API improvements
- Iterator default method forEachRemaining(Consumer action) to perform the given action for each remaining element until all elements have been processed or the action throws an exception.
- Collection default method removeIf(Predicate filter) to remove all of the elements of this collection that satisfy the given predicate.
- Collection spliterator() method returning Spliterator instance that can be used to traverse elements sequentially or parallel.
- Map replaceAll(), compute(), merge() methods.
- Performance Improvement for HashMap class with Key Collisions
7. Concurrency API improvements
- ConcurrentHashMap compute(), forEach(), forEachEntry(), forEachKey(), forEachValue(), merge(), reduce() and search() methods.
- CompletableFuture that may be explicitly completed (setting its value and status).
- Executors newWorkStealingPool() method to create a work-stealing thread pool using all available processors as its target parallelism level.
8. Java IO improvements
- BufferedReader.lines() that return a Stream, the elements of which are lines read from this BufferedReader.
- Files.list(Path dir) that returns a lazily populated Stream, the elements of which are the entries in the directory.
- Files.lines(Path path) that reads all lines from a file as a Stream.
- Files.find() that returns a Stream that is lazily populated with Path by searching for files in a file tree rooted at a given starting file.
9. Core API improvements : So many other improvements are made at the core level. Some of the main enhancements are here -
- Comparator interface has been extended with a lot of default and static methods for natural ordering, reverse order etc.
- ThreadLocal static method withInitial(Supplier supplier) to create instance easily.
- min(), max() and sum() methods in Integer, Long and Double wrapper classes.
- logicalAnd(), logicalOr() and logicalXor() methods in Boolean class.
- JJS command is added to invoke Nashorn Engine.
- JDEPS command is added to analyze class files
- JDBC-ODBC Bridge has been removed.
- PermGen memory space has been removed
- ZipFile.stream() method to get an ordered Stream over the ZIP file entries. Entries appear in the Stream in the order they appear in the central directory of the ZIP file.
Comments
Post a Comment