java.util.ArrayList

java.util.ArrayList is a class that represents non-synchronized arrays that can be resized. It implements the List interface from the Java Collection Framework.

java.util.ArrayList is essentially a non-synchronized version of the java.util.Vector class. Use this class for quick access to ordered objects.

Hints

Using a java.util.ArrayList object is an efficient way for adding, accessing, and iterating through ordered objects. However, it is one of the slowest Java Collection Framework classes for removing objects.

If the ArrayList.remove() method in your application is utilizing a high amount of CPU time, you might want to consider using a different Java Collection Framework class. Each of these classes has its own strengths and weaknesses for adding, removing, and accessing data objects. Try to select the class that best fits the needs of your application.

For example, if your application is adding and removing objects frequently, try using a java.util.HashSet object instead. Unfortunately, the HashSet object has its own disadvantages and it might not be suitable for your application.

Related Topics:

java.util.LinkedList

java.util.Vector

java.util.TreeSet

java.util.HashSet