From charlesreid1

When implementing a Stack class, according to the Abstract Data Types page, you'll want to use an interface in Java.

Here's an example Stack interface to enforce a set of uniform methods. This is much simpler than the Stack interface in the Java API.

public interface Stack<E> { 
    int size();
    boolean isEmpty();
    void push(E e);
    E pop();
    E peek();
}


Flags