1Just get the Iterator via iterator():
2
3Stack<YourObject> stack = ...
4
5Iterator<YourObject> iter = stack.iterator();
6
7while (iter.hasNext()){
8 System.out.println(iter.next());
9}
10Or alternatively, if you just want to print them all use the enhanced-for loop:
11
12for(YourObject obj : stack)
13{
14 System.out.println(obj);
15}