Question: Add a method called public Book get ( String key ) that retrieves an item given a key parameter from the HashMap. Make sure that
Add a method called public Book getString key that retrieves an item given a key parameter from the HashMap. Make sure that the key from the parameter is in the HashMap.
Add a method called public void removeString key that removes an item pairs given a key parameter from the HashMap. Make sure that the key from the parameter is in the HashMap.
Add a method called public void printAll that prints out all key and value pairs in the HashMap. Use an foreach loop.
Add a method called public void getBooksStartWithKeyString prefixthat prints
out all key and value pairs in the HashMap only if the title of the Book in the
HashMap start with the parameter prefix.
Test out all your methods in the main method. Create a new
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
