Condividi tramite


IMap.Put(Object, Object) Method

Definition

Associates the specified value with the specified key in this map (optional operation).

[Android.Runtime.Register("put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "GetPut_Ljava_lang_Object_Ljava_lang_Object_Handler:Java.Util.IMapInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Java.Lang.Object? Put (Java.Lang.Object? key, Java.Lang.Object? value);
[<Android.Runtime.Register("put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "GetPut_Ljava_lang_Object_Ljava_lang_Object_Handler:Java.Util.IMapInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Put : Java.Lang.Object * Java.Lang.Object -> Java.Lang.Object

Parameters

key
Object

key with which the specified value is to be associated

value
Object

value to be associated with the specified key

Returns

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

Attributes

Remarks

Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if #containsKey(Object) m.containsKey(k) would return true.)

Java documentation for java.util.Map.put(K, V).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to