1、ArrayList 默认大小为10 /*** Default initial capacity.*/private static final int DEFAULT_CAPACITY = 10; 最大容量为2^30 - 8 /*** The maximum size of array to allocate.* Some VMs reserve some header words
1、新增一个对象 /*** Appends the specified element to the end of this list.** @param e element to be appended to this list* @return <tt>true</tt> (as specified by {@link Collection#add})*/public boolean a
可被序列化 implements java.io.Serializableprivate static final long serialVersionUID = 8683452581122892189L; ArrayList实现了Serializable接口,并指定了serialVersionUID.说明其可以被序列化. 构造函数 ArrayList有三种构造函数 public