Re: [問題] List<E>[][] 的問題

看板java作者 (骨頭)時間18年前 (2007/05/22 10:20), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串5/5 (看更多)
※ 引述《ilovepig919 (無以名狀)》之銘言: : List<String>[][] strList =new ArrayList[5][5]; : for(int i=0;i<5;i++){ : for(int j=0;j<5;j++) : strList[i][j]=new ArrayList(); : } : 應該不是new ArrayList進去@@ : 因為你要的是字串,所以new String("XXXX"); : 只是想法,可以試試看。。 .......... you must be kidding. 不要把泛型跟型態看混囉... 一個2維的 List <> 陣列 當然是new ArrayList (或 LinkedList ,任何實作List的都可以) 進去 , 不過最好是寫 new ArrayList<String>()會比較好. 良心建議 要給建議前先跑一次試試看  ̄□ ̄||| -- I am a person, and I am always thinking . Thinking in love , Thinking in life , Thinking in why , Thinking in worth. I can't believe any of what , I am just thinking then thinking , but worst of all , most of mine is thinking not actioning... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.134.27.68
文章代碼(AID): #16KbE8ct (java)
文章代碼(AID): #16KbE8ct (java)