Question: Create a HashMap where the keys are strings representing country names ( e . g . , 'Kuwait', 'Palestine' ) and the values are their

Create a HashMap where the keys are strings representing country names (e.g., 'Kuwait', 'Palestine') and the values are their capitals (e.g., 'Kuwait', 'Al-Quds'). Add three countries and their capitals to the map, then retrieve and print the capital for one of the countries.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!