1
1
Fork 0

Добавлен Результат выполнения кода

This commit is contained in:
Arthur 2020-02-21 17:36:12 +03:00 committed by Enchased Horse
parent d685c4c5a6
commit 6d682376a5
1 changed files with 20 additions and 0 deletions

20
jcf.md
View File

@ -644,6 +644,26 @@ class CreditCard {
}
```
Результат выполнения кода:
```
adding to HM
hashCode = 1285631513
adding to IHM
before modifying keys
hashCode = 1285631513
Does VISA card exists in HashMap? Yes
Does VISA card exists in IdenityHashMap? Yes
after modifying keys
hashCode = 791156485
Does VISA card exists in HashMap? No
Does VISA card exists in IdenityHashMap? Yes
cardToExpiry.containsKey
hashCode = 791156485
false
cardToExpiryIdenity.containsKey
true
```
[к оглавлению](#java-collections-framework)
## В чем разница между `HashMap` и `WeakHashMap`? Для чего используется `WeakHashMap`?