import
java.util.*;
public
class
Identity_Hash_Map_Demo {
public
static
void
main(String[] args)
{
Map<Integer, String> identity_hash =
new
IdentityHashMap<Integer, String>();
identity_hash.put(
10
,
"Geeks"
);
identity_hash.put(
15
,
"4"
);
identity_hash.put(
20
,
"Geeks"
);
identity_hash.put(
25
,
"Welcomes"
);
identity_hash.put(
30
,
"You"
);
System.out.println(
"Initial Mappings are: "
+ identity_hash);
String returned_value = (String)identity_hash.put(
20
,
"All"
);
System.out.println(
"Returned value is: "
+ returned_value);
System.out.println(
"New map is: "
+ identity_hash);
}
}