📜  java 向后迭代器 - Java 代码示例

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

代码示例1
ArrayList<...> a = new ArrayList<...>();

// Add elements to list.

// Generate an iterator. Start just after the last element.
ListIterator li = a.listIterator(a.size());

// Iterate in reverse.
while(li.hasPrevious()) {
  System.out.println(li.previous());
}