Section 16.8 Stack Class of Package java.util

• Class Stack (p. 708) extends Vector. Stack method push (p. 709) adds its argument to the top of the stack. Method pop (p. 710) removes the top element of the stack. Method peek returns a reference to the top element without removing it. Stack method isEmpty (p. 710) determines whether the stack is empty.

Get Java™ How To Program (Early Objects), Tenth Edition 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.