作者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
→ nand:用 t[] v; 比較好 不然看 byte[] matrix[] 有時不容易看出 06/11 23:03
→ nand:其實是 byte[][] 06/11 23:06