4月21日,IntObjectLink,每日20行。

来源:互联网 发布:mac不能玩游戏的原因 编辑:程序博客网 时间:2024/05/17 22:15
import java.util.*;public class IntObjectLink {    public static void main(String[] args) {        Integer tem;        try{            LinkedList lst = new LinkedList();            for(int i = 1; i < 11; i++){                lst.addFirst(new Integer(i));            }            for(int i = 1; i < 11; i++){                tem = (Integer)lst.removeFirst();                System.out.println(tem.intValue());            }        }        catch(Exception e){            System.out.println("有错误");        }    }}

这里写图片描述

0 0
原创粉丝点击