Imagine a collection of names that are instances of the class Name, as modified in Exercise 1 of Chapter 22. For each name, imagine a string that represents a nickname. Suppose that each nickname is a...


Imagine a collection of names that are instances of the class Name, as modified in Exercise 1 of Chapter 22. 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 23.16.


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.



Dec 18, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here