静态初始化
1.type[] arrayName = new type[]{element1,….elenemtN};
如 int [] str=new int[]{2,3};
简化初始化
2.type[] arrayName = {element1,….elementN};
如:int[] str2 = {2,3};
动态初始化
type[] arrayName = new type[length];
如:int[] str3= new int[2];
1.type[] arrayName = new type[]{element1,….elenemtN};
如 int [] str=new int[]{2,3};
简化初始化
2.type[] arrayName = {element1,….elementN};
如:int[] str2 = {2,3};
type[] arrayName = new type[length];
如:int[] str3= new int[2];