Skip to content

Commit

Permalink
[docs fix]typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Snailclimb committed Apr 2, 2022
1 parent 635fb8b commit 4a50a55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/cs-basics/network/osi&tcp-ip-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ OSI 七层模型虽然失败了,但是却提供了很多不错的理论基础

⚠️注意 :**不要把运输层的“用户数据报 UDP”和网络层的“IP 数据报”弄混**

**网络层的还有一个任务就是选择合适的路由,使源主机运输层所传下来的分株,能通过网络层中的路由器找到目的主机。**
**网络层的还有一个任务就是选择合适的路由,使源主机运输层所传下来的分组,能通过网络层中的路由器找到目的主机。**

这里强调指出,网络层中的“网络”二字已经不是我们通常谈到的具体网络,而是指计算机网络体系结构模型中第三层的名称。

Expand Down
4 changes: 2 additions & 2 deletions docs/java/basis/java-basic-questions-02.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ public native int hashCode();

**那为什么 JDK 还要同时提供这两个方法呢?**

这是因为在一些容器(比如 `HashMap``HashSet`)中,有了 `hashCode()` 之后,判断元素是否在对应容器中的效率会更高(参考添加元素进`HastSet`的过程)!
这是因为在一些容器(比如 `HashMap``HashSet`)中,有了 `hashCode()` 之后,判断元素是否在对应容器中的效率会更高(参考添加元素进`HashSet`的过程)!

我们在前面也提到了添加元素进`HastSet`的过程,如果 `HashSet` 在对比的时候,同样的 `hashCode` 有多个对象,它会继续使用 `equals()` 来判断是否真的相同。也就是说 `hashCode` 帮助我们大大缩小了查找成本。
我们在前面也提到了添加元素进`HashSet`的过程,如果 `HashSet` 在对比的时候,同样的 `hashCode` 有多个对象,它会继续使用 `equals()` 来判断是否真的相同。也就是说 `hashCode` 帮助我们大大缩小了查找成本。

**那为什么不只提供 `hashCode()` 方法呢?**

Expand Down

0 comments on commit 4a50a55

Please sign in to comment.