How do you store strings in HashMap?

It can store different types: String keys and Integer values, or the same type, like: String keys and String values: Create a HashMap object called capitalCities that will store String keys and String values: The HashMap class has many useful methods. For example, to add items to it, use the put () method:
For More Information Please Refer:


You May Also Like to Read: