📜  如何在java代码示例中遍历堆栈

📅  最后修改于: 2022-03-11 14:52:04.538000             🧑  作者: Mango

代码示例1
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());
}