Last active
August 29, 2015 13:56
-
-
Save jeevan-patil/9019218 to your computer and use it in GitHub Desktop.
HashMap add method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HashMap<K,V> | |
extends AbstractMap<K,V> | |
implements Map<K,V>, Cloneable, Serializable | |
{ | |
public V put(K key, V value) { | |
if(key is already present in map) { | |
return oldValue; | |
} | |
// add new entry in hashMap | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment