Java Programming: Arrays, Lists, and Structured Data Introduction:
The Array List class that was introduced in is one of many collection classes that the standard Java library supplies. In this chapter, you will learn about the Java collections framework, a hierarchy of interface types and classes for collecting objects
Java Programming: Arrays, Lists, and Structured Data Job Support:
Each interface type is implemented by one or more classes .At the root of the hierarchy is the Collection interface. That interface has methods for adding and removing elements, and so on. . Because all collections implement this interface, its methods are available for all collection classes.
For example, the size method reports the number of elements in any collection. The List interface describes an important category of collections. In Java, a list is a collection that remembers the order of its elements. The Array List class implements the List interface.
An Array List is simply a class containing an array that is expanded as needed. If you are not concerned about efficiency, you can use the Array List class whenever you need to collect objects.
However, several common operations are inefficient with array lists. In particular, if an element is added or removed, the elements at larger positions must be moved. Input/output (I/O) devices, such as the keyboard, mouse, and monitor, allow a human being to interact with the computer.