From a06245c01c7391b36f71159e7a4ec49b383050f2 Mon Sep 17 00:00:00 2001 From: Elong Date: Tue, 7 Aug 2018 10:39:08 +0800 Subject: [PATCH] =?UTF-8?q?Update=20Java=20=E5=AE=B9=E5=99=A8.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 8和16的二进制表示问题 --- notes/Java 容器.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notes/Java 容器.md b/notes/Java 容器.md index 27a783f1..24ce2405 100644 --- a/notes/Java 容器.md +++ b/notes/Java 容器.md @@ -680,8 +680,8 @@ void transfer(Entry[] newTable) { 假设原数组长度 capacity 为 8,扩容之后 new capacity 为 16: ```html -capacity : 00010000 -new capacity : 00100000 +capacity : 00001000 +new capacity : 00010000 ``` 对于一个 Key,它的哈希值如果在第 6 位上为 0,那么取模得到的结果和之前一样;如果为 1,那么得到的结果为原来的结果 + 8。