Hashmaps store key-value pairs and are excellent for fast data retrieval based on keys.
Source Code
HashMap userAge = new HashMap();
userAge.put("John", 30);
userAge.put("Steve", 31);
System.out.println(userAge.get("John")); // Access items
Hashmaps store key-value pairs and are excellent for fast data retrieval based on keys.
HashMap userAge = new HashMap();
userAge.put("John", 30);
userAge.put("Steve", 31);
System.out.println(userAge.get("John")); // Access items