The Java programming language does not support collection literals. Adding this feature to the Java platform was proposed in 2013 and revisited in 2016, but it only gained exposure as a research proposal, and not for future implementation.
Oracle's definition of a collection literal is a syntactic expression form that evaluates to an aggregate type, such as an array, list, or map (http://openjdk.java.net/jeps/186).
Of course, that is until Java 9 was released. Implementing collection literals in the Java programming language is reported to have the following benefits:
- Performance improvement
- Increased safety
- Reduction of boilerplate code
Even without being part of the research group, our knowledge of the Java programming language clues us into additional benefits:
- The ability to write shorter code
- The ability to write space-efficient code
- The ability to make...