Write statements that add four nickname-name pairs to your


Imagine a collection of names that are instances of the class Name, as modified in Exercise 1 of Chapter 21. For each name, imagine a string that represents a nickname. Suppose that each nickname is a search key, and you plan to add nickname-name pairs to a dictionary that is an instance of the class HashMap, as described in Segment 22.18.

a. Suppose that you plan to add 1000 entries to this dictionary. Create an instance of the class HashMap that can accommodate the 1000 entries without rehashing.

b. Write statements that add four nickname-name pairs to your dictionary. Then write statements that retrieve and display the name that corresponds to a nickname of your choice.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Write statements that add four nickname-name pairs to your
Reference No:- TGS02196254

Expected delivery within 24 Hours