来源于 think in java 上 有点牛角尖的感觉 呵呵? 也许以后会用到
package eight;
import java.util.LinkedList;
import java.util.Stack;
public class StackTest {
?/**
? * @param args
? */
?public static void main(String[] args) {
??// TODO Auto-generated method stub
??Stack stack = new Stack();
??stack.push("1");
??stack.push("2");
??stack.push("3");
??System.out.println("stack"+stack.get(1));
????//结果 2??
??LinkedList list = new LinkedList();
??list.addFirst("1");
??list.addFirst("2");
??list.addLast("3");
??for(int i=0;i<list.size();i++){
???System.out.println("list"+list.get(i));
??}
??//结果 2 1 3
?}
}