Class Stack<E>

    • Constructor Detail

      • Stack

        public Stack()
    • Method Detail

      • pop

        public E pop()
        Pops and returns the last element of the stack.
        Returns:
        an element popped.
      • peek

        public E peek()
        Returns the last element of the stack without popping it.
        Returns:
        an element.
      • push

        public void push​(E element)
        Pushes an element to the stack.
        Parameters:
        element - an element.
      • setSize

        public void setSize​(int size)