LinkedList

응용 SoftWare/JAVA 2016. 12. 14. 17:00

import java.util.LinkedList;


public class LinkedListTest {


public LinkedListTest() {

//LinkedList 컬렉션은 입력 순서대로 출력

//풀력 후 객체는 삭제됨

LinkedList<String> ll = new LinkedList<String>();

ll.offer("이순신");

ll.offer("충무공");

ll.offer("홍길동");

ll.offer("1234");

ll.offer("컬렉션");

//객체 얻어오기

while(ll.size()>0){

System.out.println(ll.pop());

}

}


public static void main(String[] args) {

new LinkedListTest();


}


}



'응용 SoftWare > JAVA' 카테고리의 다른 글

TreeSet  (0) 2016.12.14
HashSet  (0) 2016.12.14
Stack  (0) 2016.12.14
Properties  (0) 2016.12.14
ArrayList  (0) 2016.12.14
Posted by Hyun CHO
,