avatar
java beginner question# Java - 爪哇娇娃
t*8
1
what's the difference between
void (char [] ch )
{
.....
};
and
void (char ch[])
{
.....
};
avatar
t*t
2
我靠,太难了。
反正我从没用过第二种,也不知道对不对。

【在 t**8 的大作中提到】
: what's the difference between
: void (char [] ch )
: {
: .....
: };
: and
: void (char ch[])
: {
: .....
: };

avatar
z*e
3
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[])
: {
: .....
: };

avatar
t*8
4
but in JDK, the code is written in the second style very often
that 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

avatar
z*3
6
没区别,你可以替换着用
main(String[] args) & main(String args[])
这两个都用过
java中数组的使用并不如其他语言中使用那么频繁
很多时候都被list等结构所取代
所以你可以不用纠结这点差异
avatar
r*r
7
有的书建议用前者,说是可读性更好。

【在 z*******3 的大作中提到】
: 没区别,你可以替换着用
: main(String[] args) & main(String args[])
: 这两个都用过
: java中数组的使用并不如其他语言中使用那么频繁
: 很多时候都被list等结构所取代
: 所以你可以不用纠结这点差异

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。