Answer:
Check the explanation
Step-by-step explanation:
Since We Know That HASHMAP Is Another Set Of Class Available Under Java Library So For That You Need To Import The Library.
HASHMAP Contain Two Attribute -
Key And Value.
In Our Question Key-> ISBN
Value - Book
So the Remaining Function Is As -
public HashMap<String,Book> buildMap(Book[] s)
{
// declaration and instantation of a new hasmap
HashMap<String,Book> h = new HashMap<String,Book>();
//for each loop to traverse through the array of books.
for(int i =0;i<s.length;i++)
{
//using the function defined in book class to get ISBN.
String k = s[i].getISBN();
//put function is used top form a new key-value pair in the hashmap
h.put(k,s[i]);
}
// after the hashmap is made return it.
return h;
}