From charlesreid1

Revision as of 05:43, 4 June 2017 by Admin (talk | contribs)

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:

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


Flags