All pastes #344754 Raw Edit

Mine

public java v1 · immutable
·published 2007-02-08 00:12 UTC
rendered paste body
class Node {	private Object o;	private Node next;	public Node(Object o) {		this.o = o;	}}class Stack {	private Node first;	private Node last;	public void push(Object o) {		if (first == null) {			first = new Node(o);			last = first;			return;		} else {			last.setNext(new Node(o));			last = last.getNext();		}	}	public Object pop() {		if (first == null) {			return null;		}		if (first == last) {			Object temp = first.getObject();			first = null;			return temp;		}		Object temp = last.getObject();		setNewLast();		return temp;	}}