/** * Pushes the object on the stack. * * @param object */ public void push(T object) { StackNode<T> stackNode = new StackNode<T>(object); stackNode.setNext(startElement); startElement = stackNode; size++; }
void push(char value) { StackNode newNode = new StackNode(value, null); if (start == null) { start = newNode; } else { newNode.setNext(start); } start = newNode; }