previous | start | next

Stack

Stack<E>
(private members)
boolean empty()
void push(E x)
E pop()
E peek()
Iterator<E> iterator()

How could a Stack client (user of Stack) print the stack elements?

Can we do it without changing the Stack contents?



previous | start | next