// ArrayList 核心字段 (JDK 17)
private transient Object[] elementData;
private,外部不可直接訪問,所有增刷改查由 ArrayList 方法完成。add() 時檢查容量,不足則 Arrays.copyOf 擴容(1.5 倍)。trimToSize() 將容量縮減至 size。modCount,結構變更拋 ConcurrentModificationException。ArrayList 是一個「倉庫管理員」,Object[] 是「貨架」。管理員負責:
這一系列「照看、調度、保護」動作,就是 maintenance(維護) 的準確語義——不僅是「有一個數組」,而是「全生命週期管理這個數組」。