Snippets tagged “immutable”
1 snippet uses this tag.
- How can I initialise a static Map?Java
To initialize a static Map in Java, you can use the Map interface's of method, which was added in Java 9. The of method creates an immutable Map with a fixed set of key-value pairs.