1 public static void main(String[] args) 2 { 3 int[] arry = new int[4]; //int 默认值0 //浮点型 0.0 4 for(int i =0; i < arry.length;i++) 5 { 6 System.out.println(arry[i]); 7 } 8 9 System.out.println("-----------"); 10 char[] arr1 = new char[5]; //默认值是 0 ascall码0 11 int i =0; 12 for( i =0; i <arr1.length;i++) 13 { 14 System.out.println("------"+arr1[i]+"-------"); 15 } 16 17 if(arr1[0]==0) 18 { 19 System.out.println("你好"); 20 } 21 22 boolean[] arr4 = new boolean[5]; 23 System.out.println(arr4[0]); //默认值是false 24 25 String[] arr5 = new String[5]; 26 27 System.out.println(arr5[0]); // 引用数据类型 默认值是 null 没有赋值 28 29 if(arr5[0]== null) 30 { 31 System.out.println("zhenglei"); 32 } 33 34 }