11.7. Lists

Java lists allow you to perform the same kinds of operations that ColdFusion lists do. Lists have these chief characteristics:

  • Lists store their data in an ordered fashion known as a sequence.

  • Because the data is ordered, you can refer to individual elements by position. Position is an integer index.

  • Lists allow duplicate elements. This is in contrast to other types of collections, such as sets, which do not allow duplicates.

  • Lists are zero-based like Java arrays. This is in contrast to a ColdFusion list, the first element of which has an index of 1.

11.7.1. LinkedList

The LinkedList is much like an ArrayList (discussed below). It offers a way to store objects each in their own link. A link stores a reference to the prior and next links ...

Get Java™ for ColdFusion® Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.