The built-in Map
is an interface, which cannot be instantiated. You can choose between lots of implementing concrete classes on the right side of your assignment, such as:
ConcurrentHashMap
HashMap
LinkedHashMap
TreeMap
and many others. The Javadocs for Map
lists many direct concrete implementations.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…