首页 > 代码库 > Java 数组遍历

Java 数组遍历

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();}

 

Java 数组遍历