public void pop() { // pops the data on the top of the stack //topand pop if (theList.isEmpty()) { System.out.println("sorry but the stack is empty"); } else { theList.deleteFirst(); } }
// -------------------------------------------------------------- public long pop() // take item from top of stack { return theList.deleteFirst(); }