Java Cup
Inside Java

News and views from members of the Java team at Oracle

Factory Methods for Collections - JEP Café #6

This JEP Café discusses 'Convenience Factory Methods for Collections' (JEP 269), released with JDK 9. Factory methods allow to create pre-filled collections and maps, that are immutable, that do not accept null values or keys, and that are Serializable. Let us quickly visit them, along with Arrays.asList(), List.copyOf() and the new Stream.toList() methods.

Show Notes

Further reading and viewing:

JDK releases:

Additional Resources

JEP Café explores Java features and JDK Enhancement Proposals through tutorials and practical examples. Watch all episodes in the YouTube playlist. For more Java news, subscribe to our RSS feed and follow @Java on X.

Contact us.