public class ArrayDefaultValue {
public static void main(String[] args){
int[] iArr=new int[3];
byte[] bArr=new byte[3];
short[] sArr=new short[3];
char[] cArr=new char[3];
long[] lArr=new long[3];
float[] fArr=new float[3];
double[] dArr=new double[3];
boolean[] booArr=new boolean[3];
System.out.println("int[]默认值:"+iArr[0]);
System.out.println("byte[]默认值:"+bArr[0]);
System.out.println("short[]默认值:"+sArr[0]);
System.out.println("char[]默认值:"+cArr[0]+"abc");
System.out.println("long[]默认值:"+lArr[0]);
System.out.println("float[]默认值:"+fArr[0]);
System.out.println("double[]默认值:"+dArr[0]);
System.out.println("boolean[]默认值:"+booArr[0]);
}
} |
|