1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-16 18:10:13 +08:00

Merge pull request #385 from yellowgg/master

更正了markdown语法错误
This commit is contained in:
SnailClimb 2019-07-13 13:28:41 +08:00 committed by GitHub
commit 71c1a40a3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -660,7 +660,7 @@ public class ArrayList<E> extends AbstractList<E>
(3)private class SubList extends AbstractList<E> implements RandomAccess
(4)static final class ArrayListSpliterator<E> implements Spliterator<E>
```
  ArrayList有四个内部类其中的**Itr是实现了Iterator接口**,同时重写了里面的**hasNext()****next()****remove()**等方法;其中的**ListItr**继承**Itr**,实现了**ListIterator接口**,同时重写了**hasPrevious()****nextIndex()****previousIndex()****previous()****set(E e)****add(E e)**等方法,所以这也可以看出了 **Iterator和ListIterator的区别:**ListIterator在Iterator的基础上增加了添加对象修改对象逆向遍历等方法这些是Iterator不能实现的。
  ArrayList有四个内部类其中的**Itr是实现了Iterator接口**,同时重写了里面的**hasNext()** **next()** **remove()** 等方法;其中的**ListItr** 继承 **Itr**,实现了**ListIterator接口**,同时重写了**hasPrevious()** **nextIndex()** **previousIndex()** **previous()** **set(E e)** **add(E e)** 等方法,所以这也可以看出了 **Iterator和ListIterator的区别:** ListIterator在Iterator的基础上增加了添加对象修改对象逆向遍历等方法这些是Iterator不能实现的。
### <font face="楷体" id="6"> ArrayList经典Demo</font>
```java