표준입력 (stdin)
실행옵션 (runtime option)
코드:
실행 »
표준입력/실행옵션
import java.util.*; public class prog { public static void main(String[] args) { LinkedList<Integer> lnkList = new LinkedList<Integer>(); lnkList.add(4); lnkList.add(2); lnkList.add(3); lnkList.add(1); ListIterator<Integer> iter = lnkList.listIterator(); while (iter.hasNext()) { System.out.print(iter.next() + " "); } System.out.println(); while (iter.hasPrevious()) { System.out.print(iter.previous() + " "); } } }