Java IdentityHashMap putAll() methodThe putAll(Map<? extends K, ? extends V> m) method of the Java IdentityHashMap class is used to copy all the key-value pairs from the specified Map to the calling IdentityHashMap. SyntaxReturnm - Map from which key-value pairs are to be copied Example 1Test it NowOutput: {Java=1, the=3, language=6, programming=5, best=4, is=2} {} {Java=1, the=3, language=6, programming=5, best=4, is=2} Example 2Test it NowOutput: {1=Student@70dea4e, 3=Student@5c647e05, 2=Student@33909752, 4=Student@55f96302} {} {1=Student@70dea4e, 3=Student@5c647e05, 2=Student@33909752, 4=Student@55f96302}
Next TopicJava IdentityHashMap
|