在上面的範例中,由於宣告 collector 時已經指定了 List<Integer> ,表示要收集的元素都是 Integer ,因此建構實作物件 ArrayList 時,就不用於 <> 中再指定 Integer 型態 ...
確定! 回上一頁