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 1Output: null null 12 null null 4 null null {Java=1, the=3, language=6, programming=5, best=4, is=2} Example 2Output: null null null null [1, 3, 2, 4] Next TopicJava-identityhashmap-keyset-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India