10.7实战演练第一题

 1 package zuoye;
 2 import java.util.*;
 3 public class Jihe {
 4 
 5     public static void main(String[] args) {
 6         // TODO Auto-generated method stub
 7         List<Object>list=new ArrayList<Object>();
 8         for(int i=0;i<101;i++)
 9         {
10             list.add(i);
11         }
12         System.out.print("移除索引为10的对象前:");
13         for(Object t:list)
14         {
15             System.out.print(" "+t);
16         }
17         
18         list.remove(10);
19         System.out.println();
20         System.out.print("移除索引为10的对象后:");
21         for(Object t:list)
22         {
23             System.out.print(" "+t);
24         }
25     }
26 
27 }
View Code

posted on 2016-03-10 14:13  beens  阅读(120)  评论(0编辑  收藏  举报

导航