Java IdentityHashMap remove() methodThe remove(Object key) method of the Java IdentityHashMap class is used remove the linkage of the specified key, from the calling IdentityHashMap, if present. SyntaxParameterskey - Key whose linkage is to be removed. ReturnThe previous value linked with the specified key, or null if there was no linkage. Example 1Test it NowOutput: {Java=1, the=3, language=6, programming=5, best=4, is=2} 3 4 {Java=1, language=6, programming=5, is=2} Example 2Test it NowOutput: {1=Student@70dea4e, 3=Student@5c647e05, 2=Student@33909752, 4=Student@55f96302} Student@33909752 Student@5c647e05 {1=Student@70dea4e, 4=Student@55f96302}
Next TopicJava IdentityHashMap
|