public class GenericLinkedListBasedStack { private class Node { Item value; Node next; Node (Item theValue, Node theNext) { value = theValue; next = theNext; } } Node head = null; boolean isEmpty () { return (head == null); } void push (Item value) { head = new Node(value, head); } Item pop () { Item ret = head.value; head = head.next; return ret; } }