[JAVA API] java.util.Stack<E> :: 소림사의 홍반장!

[JAVA API] java.util.Stack<E>

2012. 8. 7. 14:20 - 삘쏘굿

Stack 사용 예제

 

 

java.util

Class Stack<E>

  • All Implemented Interfaces:
    Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess


    public class Stack<E>
    extends Vector<E>
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with five operations that allow a vector to be treated as a stack. The usual push and pop operations are provided, as well as a method to peek at the top item on the stack, a method to test for whether the stack is empty, and a method to search the stack for an item and discover how far it is from the top.

    When a stack is first created, it contains no items.

    A more complete and consistent set of LIFO stack operations is provided by the Deque interface and its implementations, which should be used in preference to this class. For example:

       Deque<Integer> stack = new ArrayDeque<Integer>();
    Since:
    JDK1.0
    See Also:
    Serialized Form

'Dev. 자바 > API 및 이론' 카테고리의 다른 글

[JAVA API] java.util.HashMap<K,V>  (0) 2012.08.07
[JAVA API] java.lang.Exception  (0) 2012.08.07
[JAVA API] java.util.ArrayList<E>  (0) 2012.08.07
[JAVA API] java.lang.System  (0) 2012.08.03
[JAVA API] java.lang.Math  (0) 2012.08.03

다른 카테고리의 글 목록

Dev. 자바/API 및 이론 카테고리의 포스트를 톺아봅니다