ArrayList<Integer> al = new ArrayList<Integer>(); //数组定义 //遍历数组: int sum = 0; Iterator<Integer> itr = al.iterator(); while(itr.hasNext()){ Integer intObj = (Integer)itr.next(); sum += intObj.intValue(); }