📅  最后修改于: 2022-03-11 14:52:04.538000             🧑  作者: Mango
Iterator value = stack.iterator();
// Displaying the values
// after iterating through the stack
System.out.println("The iterator values are: ");
while (value.hasNext()) {
System.out.println(value.next());
}