08-数组和数组的增强for循环
public class demo004 {
public static void main(String[] args) {
int[] arrs = {1,2,3,4,5};
System.out.println(arrs);
int sum = 0;
for (int i = 0; i < arrs.length; i++) {
sum += arrs[i];
}
System.out.println(sum);
// 增强for循环
for (int temp :arrs){
System.out.println(temp);
}
}
}