name: inverse layout: true class: taylor msoe --- class: center, middle .title[ # ArrayList ] ??? Toggle speaker view by pressing P Pressing C clones the slideshow view, which is the view to put on the projector if you're using speaker view. Press ? to toggle keyboard commands help. --- # Wrapping an Array in a Class * Give behaviors to an array -- * Simplify managing lists of data -- * The `ArrayList` implements the methods in the `List` inteface -- * The `List` interface adds index-based methods to the `Collection` inteface ??? --- # Implements `List` * `size()`/`isEmpty()`/`clear()` -- * `add(E)`/`remove(Object)`/`contains(Object)` -- * `get(int)`/`set(int, E)` -- * `add(int, E)`/`remove(int)`/`indexOf(Object)` -- * `toArray()` --- class: animated slideInUp center, middle # ArrayList Internals ``` List
list = new ArrayList<>(); list.add("dog"); list.add(null); list.add("pig"); list.add("cat"); list.add("cow"); list.add(null); ```