package day04; public class ShuZu_BianLi_02 { public static void main(String[] args) { // TODO Auto-generated method stub //数组的操作: //获取数组中的元素 int [] arr=new int[3]; arr[0]=20; arr[1]=22; arr[2]=32; int sum=0; // System.out.println("arr[0]="+arr[0]); for(int i=0;i<arr.length;i++){ System.out.println("arr["+i+"]="+arr[i]); sum+=arr[i]; } System.out.println(sum); for(int i=0;i<arr.length;i++){ if(i!=arr.length-1){ System.out.print(arr[i]+","); }else{ System.out.println(arr[i]); } } System.out.println(arr); //[I@62efae3b 数组 int型 哈希值 } }