The following example shows how to create Stack and its basic operations.
Stack provides the following APIs,
public E push(E paramE)
- Pushes an element onto the top of stack.
public synchronized E pop()
- Removes the element at top of stack.
public boolean empty()
- Returns true if the stack is empty otherwise false.