當前位置:聚美館>智慧生活>心理>

list內部用的數組嗎

心理 閱讀(3.25W)
list內部用的數組嗎

是用的數組,第一行的傳參肯定是int a 。然後後面跟一個二維數組或是list集合類型

但是如果是數組的話,長度卻要隨着第一個int改變。這是不行的。

如果是集合list<> ,集合<>裏面應該放string還是數組呢Sting應該沒問題,用spit分割空格,就可以得到每一行的數字。數組也不是不可以

public int[] zj(int a ,List<Integer[]> ab) {

int ans[]=new int [3]

List<String> aList = new ArrayList<String>()

Integer m=new Integer(1)

Integer m2=new Integer(2)

Integer s[]= {m,m2}

(s)

這個樣子也可以,不報錯。但是很麻煩,需要一個一個new,很顯然不可能是這樣操作。