Re: [問題] List<E>[][] 的問題
※ 引述《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
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 5 之 5 篇):