很白痴的问题,大家帮帮忙。

解决方案 »

  1.   

    能举个例子么?
    比如
    ArrayList al = new ArrayList();
    while(found)
    {
        String str = .... ;
        al.add(str)
    }
    这样是用arraylist装string,装int怎么装呢?
      

  2.   

        ArrayList<Integer> list = new ArrayList<Integer>();
        int[] nums = new int[] { 1, 2, 3, 4 };
        for (int num : nums) {
          list.add(num);
        }
      

  3.   

    ArrayList   al   =   new   ArrayList(); 
    int a = 10;
    Integer i = new Integer(a); 
    al.add(i);
    取值用 int b = i.intValue();