Arrays and ArrayLists are the fundamental data structures for storing collections of elements in Java. An array is a fixed-size, ordered collection of elements of the same type, declared with bracket notation (int[] arr = new int[5]) and accessed by zero-based index. Arrays support efficient random access but cannot be resized after creation.
ArrayLists are part of the java.util package and provide a resizable alternative to arrays. They store objects (not primitives), support dynamic sizing with methods like add(), remove(), get(), set(), and size(), and handle autoboxing for primitive wrapper types. Understanding when to use arrays versus ArrayLists is a key design decision in Java programming.
This topic also covers array traversal using standard for loops and enhanced for-each loops, common algorithms (searching, finding min/max, summing, reversing), 2D arrays for tabular data, and the important distinction between passing arrays by reference versus passing primitives by value. These concepts form the foundation of AP Computer Science A Units 6 and 7, comprising 10-15% of the AP exam.