Removes the mapping for a key from this map if it is present
(optional operation). More formally, if this map contains a mapping
from key k to value v such that
(key==null ? k==null : key.equals(k)), that mapping
is removed. (The map can contain at most one such mapping.)
Returns the value to which this map previously associated the key, or null if the map contained no mapping for the key.
If this map permits null values, then a return value of null does not necessarily indicate that the map contained no mapping for the key; it's also possible that the map explicitly mapped the key to null.
The map will not contain a mapping for the specified key once the call returns.
key | key whose mapping is to be removed from the map |
UnsupportedOperationException | if the remove operation is not supported by this map | |
ClassCastException | if the key is of an inappropriate type for this map (optional) | |
NullPointerException | if the specified key is null and this map does not permit null keys (optional) |
Diagram: Map Simple