Java Reference
In-Depth Information
On the other hand, you can think of the abstract concept of the linked list. In the
abstract, a linked list is an ordered sequence of data items that can be traversed with
an iterator (see Figure 9 ).
An abstract data type defines the fundamental operations on the data but does not
specify an implementation.
Similarly, there are two ways of looking at an array list. Of course, an array list has a
concrete implementation: a partiall y filled array of object references (see Figure 10 ).
But you don't usually think abou t the concrete implementation when using an array
list. You take the abstract point of view. An array list is an ordered sequence of data
items, each of which can be accessed by an integer index (see Figure 11 ).
682
683
Figure 8
A Concrete View of a Linked List
Figure 9
An Abstract View of a Linked List
The concrete implementations of a linked list and an array list are quite different. The
abstractions, on the other hand, seem to be similar at first glance. To see the
difference, consider the public interfaces stripped down to their minimal essentials.
Search WWH ::




Custom Search