Re: [問題] 我的hello world 跑不出來

看板java作者 (反及閘萬用閘)時間14年前 (2010/06/11 23:00), 編輯推噓0(002)
留言2則, 1人參與, 最新討論串3/3 (看更多)
※ 引述《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

06/11 23:03, , 1F
用 t[] v; 比較好  不然看 byte[] matrix[] 有時不容易看出
06/11 23:03, 1F

06/11 23:06, , 2F
其實是 byte[][]
06/11 23:06, 2F
文章代碼(AID): #1C4a-cpB (java)
文章代碼(AID): #1C4a-cpB (java)