作者nand (反及闸万用闸)
看板java
标题Re: [问题] 我的hello world 跑不出来
时间Fri Jun 11 23:00:51 2010
※ 引述《mar3 (小马)》之铭言:
: ※ 引述《mar3 (小马)》之铭言:
: : public class 001{
: : public static void main(String[ ] args){
: 想问大大上面这行
: 把 args 和 [ ] 互换位置变成 (String args[ ])
: 请问这两行有什麽不同 (虽然说都可以跑没问题)
: 爬文找不到(应该是很基础的东西 所以没人问吧^^")
: 抱歉看书自学 看到书上打的不一样 也找不到答案
http://java.sun.com/docs/books/jls/third_edition/html/arrays.html#10.2
The [] may appear as part of the type at the beginning of the declaration,
or as part of the declarator for a particular variable, or both,
as in this example:
byte[] rowvector, colvector, matrix[];
This declaration is equivalent to:
byte rowvector[], colvector[], matrix[][];
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 125.225.160.241
1F:→ nand:用 t[] v; 比较好 不然看 byte[] matrix[] 有时不容易看出 06/11 23:03
2F:→ nand:其实是 byte[][] 06/11 23:06