public void push(Node node) { node.next = top; top = node; count++; }
public Node pop() { if (top == null) { throw new ElementOutOfBoundsException(); } else { Node temp = top; top = top.next; count--; return temp; } }
public void push(Node node) { node.next = top; top = node; count++; }
public Node pop() { if (top == null) { throw new ElementOutOfBoundsException(); } else { Node temp = top; top = top.next; count--; return temp; } }