From 6d682376a52322365da6577a4eb693091d5b5b72 Mon Sep 17 00:00:00 2001 From: Arthur Date: Fri, 21 Feb 2020 17:36:12 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=A0=D0=B5=D0=B7=D1=83=D0=BB=D1=8C=D1=82=D0=B0=D1=82?= =?UTF-8?q?=20=D0=B2=D1=8B=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jcf.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/jcf.md b/jcf.md index a58bef5..82c93cc 100644 --- a/jcf.md +++ b/jcf.md @@ -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`?