Interface Enumeration<E> (iterator 와 똑같은 기능임)
Class StringTokenizer
Class LinkedList<E> 잘 안씀
ArrayList 써
Deque<E>, List<E>, Queue<E>(대기를 탄다) Q자료구조 순서대로 들어감(선입선출)
LIFO
offer 많이 씀
peek()
Retrieves, but does not remove, the head (first element) of this list.
poll()
Retrieves and removes the head (first element) of this list.
while(!stack.isEmpty()) {
System.out.println(stack.pop());//지움
//System.out.println(stack.peek()); 객체를 지우지 않음
}
System.out.println("---Queue---");
while(!q.isEmpty()) {
System.out.println(q.poll());
뒤로가기 앞으로가기 저장 가능