Collections Refueled

Java collections is one of the most used frameworks in Java with array lists being the most popular functionality. In his presentation, Stuart Marks dives into the new features of collections in Java 8, as well as what’s coming in Java 9. For those of you who don't know Stuart, he works on JDK core libraries at Oracle. 

Most developers have moved to JDK 8 by now, and Stuart describes the new JDK 8 features that you might have overlooked.  One of those new features is the introduction of a set of default methods to the collection interfaces. Default methods enable you to add methods to existing interfaces without breaking compatibility; e.g., converting a collection into a stream. 

Stuart goes over some improvements to Iterable, Collection and List: 

The collection interfaces with the newest methods are Map and Comparator. Stuart drills down and gives you examples: 

In Java 9 improvements to the collections framework include factory methods for collections, which introduce methods that make it easy to create collections.

You can learn more about the JEPs in Java 9 on the OpenJDK website. Here is a direct link to the aforementioned JEP 269 - Convenience factory methods for collections

Check out the changes to Java 9 in the OpenJDK community. Try out the JDK 9 early access build at http://jdk.java.net/9/ and provide feedback on the early access forum 

JDK 9 documentation early access is available here. Another must-read is the new AdoptOpenJDK community GitHub website with articles, use cases and much more.  

More information about module system and JDK 9 can be found online: 
JEP 261: Module System 
JEP 200: The Modular JDK 
JDK 9 release 
Release notes  
Java 9 expert insights
JDK 9 documentation 
Migration guide
Java SE & JDK 9 API Specification
Oracle JDK 9 and JRE 9 Certified System Configurations

Related blog: Modular Development with JDK 9 
Two editions of Java Magazine are dedicated to Java 9. Register for free! 

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.