Skip to content

Commit

Permalink
修改错别字
Browse files Browse the repository at this point in the history
  • Loading branch information
Snailclimb authored Oct 1, 2018
1 parent ec28415 commit ad8d433
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Java相关/ArrayList-Grow.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ public class EnsureCapacityTest {

```
使用ensureCapacity方法前:4637
使用ensureCapacity方法前:241
使用ensureCapacity方法后:241
```

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

0 comments on commit ad8d433

Please sign in to comment.