The Java API provides several predefined data structures, called collections, used to store groups of related objects. These classes provide efficient methods that organize, store and retrieve your data without requiring knowledge of how the data is being stored. This reduces application-development time.
You’ve used arrays to store sequences of objects. Arrays do not automatically change their size at execution time to accommodate additional elements. The collection class
ArrayList<T> (from package
java.util) provides a convenient solution to this problem—it can dynamically change its size to accommodate more elements. The
T (by convention) is a placeholder—when declaring a new