Skip to content

Instantly share code, notes, and snippets.

@jeevan-patil
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeevan-patil/9019218 to your computer and use it in GitHub Desktop.
Save jeevan-patil/9019218 to your computer and use it in GitHub Desktop.
HashMap add method
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