Cover Data Structures and Algorithms with Object-Oriented Design Patterns in Java
next up previous contents index

Fields

The implementation of the StackAsLinkedList class makes use of one field--an instance of the LinkedList class called list. In addition, the StackAsLinkedList class inherits the count field from the AbstractContainer class. This list is used to keep track of the objects in the stack. As a result, there are as many elements in the linked list as there are objects in the stack.


next up previous contents index

Bruno Copyright © 1998 by Bruno R. Preiss, P.Eng. All rights reserved.