类 Stack<E>


  • public class Stack<E>
    extends Object
    Stack.
    • 构造器详细资料

      • Stack

        public Stack()
    • 方法详细资料

      • push

        public void push​(E ele)
        push.
        参数:
        ele -
      • pop

        public E pop()
        pop.
        返回:
        the last element.
      • peek

        public E peek()
        peek.
        返回:
        the last element.
      • get

        public E get​(int index)
        get.
        参数:
        index - index.
        返回:
        element.
      • set

        public E set​(int index,
                     E value)
        set.
        参数:
        index - index.
        value - element.
        返回:
        old element.
      • remove

        public E remove​(int index)
        remove.
        参数:
        index -
        返回:
        element
      • size

        public int size()
        get stack size.
        返回:
        size.
      • isEmpty

        public boolean isEmpty()
        is empty.
        返回:
        empty or not.
      • clear

        public void clear()
        clear stack.