February 2014
Beginner
1248 pages
62h 25m
English
We introduced the concept of a stack in Section 6.6 when we discussed the method-call stack. In Chapter 21, Custom Generic Data Structures, we’ll learn how to build data structures, including linked lists, stacks, queues and trees. In a world of software reuse, rather than building data structures as we need them, we can often take advantage of existing data structures. In this section, we investigate class Stack in the Java utilities package (java.util).
Class Stack extends class Vector to implement a stack data structure. Figure 16.14 demonstrates several Stack methods. For the details of class Stack, visit http://docs.oracle.com/javase/7/docs/api/java/util/Stack.html.
Read now
Unlock full access