java beginner question# Java - 爪哇娇娃t*82014-09-18 07:091 楼what's the difference betweenvoid (char [] ch ){.....};andvoid (char ch[]){.....};
t*t2014-09-18 07:092 楼我靠,太难了。反正我从没用过第二种,也不知道对不对。【在 t**8 的大作中提到】: what's the difference between: void (char [] ch ): {: .....: };: and: void (char ch[]): {: .....: };
z*e2014-09-18 07:093 楼in might be wrong.the first is java style, and is recommended, the s e c o nd is c style【在 t**8 的大作中提到】: what's the difference between: void (char [] ch ): {: .....: };: and: void (char ch[]): {: .....: };
t*82014-09-18 07:094 楼but in JDK, the code is written in the second style very oftenthat is,void (char ch[]){};【在 z*********e 的大作中提到】: in might be wrong.: the first is java style, and is recommended, the s e c o nd is c style
z*e2014-09-18 07:095 楼https://www.google.com/url?sa=t&source=web&rct=j&ei=efsdVN_2EdOSyASMvYKQCg&url=http://stackoverflow.com/questions/13175193/java-array-convention-string-args-vs-string-args&cd=2&ved=0CCAQFjAB&usg=AFQjCNHCb1KfLy9o-dwPceeKvPYUzkmIow【在 t**8 的大作中提到】: but in JDK, the code is written in the second style very often: that is,: void (char ch[]): {: };
z*32014-09-18 07:096 楼没区别,你可以替换着用main(String[] args) & main(String args[])这两个都用过java中数组的使用并不如其他语言中使用那么频繁很多时候都被list等结构所取代所以你可以不用纠结这点差异
r*r2014-09-18 07:097 楼有的书建议用前者,说是可读性更好。【在 z*******3 的大作中提到】: 没区别,你可以替换着用: main(String[] args) & main(String args[]): 这两个都用过: java中数组的使用并不如其他语言中使用那么频繁: 很多时候都被list等结构所取代: 所以你可以不用纠结这点差异