Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cc12caa

Browse files
Merge pull request Snailclimb#1 from lewisbyte/lewisbyte-patch-1-fix-typo
Update ArrayList源码+扩容机制分析.md
2 parents 6d0d203 + faf3ae3 commit cc12caa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎docs/java/collection/ArrayList源码+扩容机制分析.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ public class EnsureCapacityTest {
894894
运行结果:
895895

896896
```
897-
使用ensureCapacity方法前:1773
897+
使用ensureCapacity方法后:1773
898898
```
899899

900900
通过运行结果,我们可以看出向 ArrayList 添加大量元素之前最好先使用`ensureCapacity` 方法,以减少增量重新分配的次数。

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /