Java IdentityHashMap put() methodThe put(K key, V value) method of the Java IdentityHashMap class is used to link the specified key with a specified value in the calling IdentityHashMap. SyntaxParametersKey - The key with which the specified value is to be linked. Value - The value which is to be linked with the specified key. ReturnThe previous value associated with the key or null if there was no linkage for the specified key. Example 1Test it NowOutput: null null 12 null null 4 null null {Java=1, the=3, language=6, programming=5, best=4, is=2} Example 2Test it NowOutput: null null null null [1, 3, 2, 4]
Next Topicjava IdentityHashMap
|