auto commit
This commit is contained in:
parent
7619c02dd0
commit
54e77a0131
|
@ -107,7 +107,8 @@ java.util.Arrays#asList()
|
|||
实现了 RandomAccess 接口,因此支持随机访问,这是理所当然的,因为 ArrayList 是基于数组实现的。
|
||||
|
||||
```java
|
||||
public class ArrayList<E> extends AbstractList<E> implements List<E>, RandomAccess, Cloneable, java.io.Serializable
|
||||
public class ArrayList<E> extends AbstractList<E>
|
||||
implements List<E>, RandomAccess, Cloneable, java.io.Serializable
|
||||
```
|
||||
|
||||
基于数组实现,保存元素的数组使用 transient 修饰,这是因为该数组不一定所有位置都占满元素,因此也就没必要全部都进行序列化。需要重写 writeObject() 和 readObject()。
|
||||
|
|
BIN
pics/ebf03f56-f957-4435-9f8f-0f605661484d.jpg
Normal file
BIN
pics/ebf03f56-f957-4435-9f8f-0f605661484d.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 59 KiB |
Loading…
Reference in New Issue
Block a user