put

open override fun put(key: K, value: V): V?

Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced.

Return

the previous value associated with key, or null if there was no mapping. (A null return can also indicate that the map previously associated null with key.)

Parameters

key

key with which the specified value is to be associated

value

value to be associated with the specified key

Throws

if the key cannot be compared

if key is null and nulls are not supported