Returning get() method in put() method in a Hash Map
Hi, I'm new to the site and just have a quick question about a project I'm working on.
I'm making a Library catalogue program, and working on the checkoutItem() method. It's a method that checks out an item if not already checked out. If the book is not checked out, get() should return null.
Could anyone lend a hand?
* Return who has given book
* Null if not checked out.
public Patron whoHas(Item i)
*Uses WhoHas() method for this
public boolean checkOutItem(Item i, Patron p)
checkoutsMap.put(i, p); //Assign item variable to patron variable in the Hash Map
Re: Returning get() method in put() method in a Hash Map
What does the compiler have to say about this line?