- String s[]=new String[]{"Zero","One","Two"," Three"};
- String []s2={"Zero","One","Two"," Three"};
- String s1[4]=new String[]{"Zero","One","Two"," Three"};//Syntax error on token "4", delete this token
-
- int a[]=new int[]{1,2,3};
- int a1[3]=new int[]{1,2,3}; //Syntax error on token "3", delete this token
复制代码 其中s1和a1编译要报错,报错的内容在//后
我记得在等号前的[]不输入数字可以,但是输入了也可以啊,输入了就表示我给这个数组定义了大小,划分了空间啊。
难道java里面不能这样,还是我理解上有错误 |
|