0
public class Stack<Item> implements Iterable<Item> {
private int N; // size of the stack
private Node<Item> first; // top of stack
// helper linked list class
private static class Node<Item> {
private Item item;
private Node<Item> next;
}
....
为什么泛型参数类型为{ITEM}不是{}节点这里的泛型参数类型的一些疑问?毕竟,我们正在迭代的是节点。
你检查过你提供的链接中的'private static class Node- '吗? –
任何。这有什么不同? – javarookie