Re: [問題] 動態宣告?

看板java作者 (狗狗洋ˇ洋)時間16年前 (2010/02/28 12:45), 編輯推噓0(002)
留言2則, 2人參與, 最新討論串3/4 (看更多)
※ 引述《johnny1713 (蛤)》之銘言: : 如果想要一次宣告很多Arraylist : ArrayList<String> doc_1 = new ArrayList<String>(); : ArrayList<String> doc_2 = new ArrayList<String>(); : ArrayList<String> doc_3 = new ArrayList<String>(); : ArrayList<String> doc_4 = new ArrayList<String>(); : . : . : . : . : . : . : 以此類推... : 要怎麼宣告呢@@? import java.util.ArrayList; public class ddd { class doc{ public ArrayList<String> doc =new ArrayList<String>(); } public static void main(String[] args) { doc[] docSet=new doc[10]; } } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.57.134.112

02/28 14:02, , 1F
創意無限… XD
02/28 14:02, 1F

03/01 00:23, , 2F
很無言...... =____=;;;
03/01 00:23, 2F
文章代碼(AID): #1BYVJxIN (java)
文章代碼(AID): #1BYVJxIN (java)