我試圖找到這個簡單的代碼有什麼問題,我試圖在本網站上搜索樣本,但無法找到它。 我想創建數組列表。所以當我調用myList.get(0)時,它會輸出第一個數組1。如果myList.get(0)[0]是第一個值。 謝謝 我的代碼:列表中的數組
List<int[]> myList = new ArrayList<int[]>();
int[] array1 = {15, 20, 40};
int[] array2 = {30, 7, 18};
myList.add(array1);
myList.add(array2);
System.out.println(myList);
給出了這個類型的輸出。 [我@ 129f3b5,[I @ 13f3045]
其完全正確,您期望和未發生什麼 –
大家感謝您的回答。 – Sergey