package DataStructures; /** * A last-in-first-out (LIFO) stack of objects. * @author Peter Williams */ public interface Stack { /** * Indicates the status of the stack. * @return true if the stack is empty. */ public boolean isEmpty(); /** * Pushes an item onto the stack. * @param item the Object to be pushed. */ public void push(Object item); /** * Pops an item off the stack. * @return the item most recently pushed onto the stack * @exception NoSuchElementException if the stack is empty. */ public Object pop(); }