Question: Programming Language : Java Create your own hashmap interface with the following method: put(key, value) this method insert key/value pairs into the table. toString() this
Programming Language : Java
- Create your own hashmap interface with the following method:
- put(key, value) this method insert key/value pairs into the table.
- toString() this method printing the entire HashMap object.
- size() this method is used to return the size of the HashMap object.
- keySet() this method returns a Set object containing all the keys.
- keyValue() - this method returns a Collection object containing all the values.
- get(key) this method returns the value for a given key.
- remove(key) this method deletes the pair.
- clear() this method remove all items.
- containsKey(key) this method returns true if the key is retrieve otherwise return false.
- containsValue(value) this method returns true if the value is retrieve otherwise return false.
Write also a program to implement your interface. Test all our method, Print screen the output, write a comment and make it neat.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
