Class ArrayStack<E>

    • Constructor Detail

      • ArrayStack

        public ArrayStack​(int size)
        Creates an empty Stack with an initial size.
      • ArrayStack

        public ArrayStack()
        Creates an empty Stack.
    • Method Detail

      • push

        public void push​(E item)
        Pushes an item onto the top of this stack.
      • pop

        public E pop()
        Removes the object at the top of this stack and returns that object as the value of this function.
      • peek

        public E peek()
        Returns the object at the top of this stack without removing it.
      • peekWithNull

        public E peekWithNull()
        Returns the object at the top of this stack without removing it. If the stack is empty this returns null.
      • isEmpty

        public boolean isEmpty()
        Tests if this stack is empty.
      • size

        public int size()
      • contains

        public boolean contains​(E o)