KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
If I statically initialize a map and set the reference to a Collections.unmodifiableMap(Map m). Do I need to synchronize reads? private static final Map<String,String> staticMap; static{ Map<String,String> tempMap = new HashMap<String,String>(); tempMap.put("key 1","value 1"); tempMap.put("key 2","value 2"); tempMap.put("key 3","value 3"); staticMap = Collections.unmodifiableMap(tempMap); }
Tags (comma-separated)
Save Edits
Cancel