文章

顯示包含「List」標籤的文章

J Java - Data structure - List /ArrayList to array

Approch1 :  Car[] carArr = cars.toArray(new Car[0]); Approch 2 : Car[] carArr2 = cars.stream()..filter(e -> e != null).toArray(c-> new Car[c]); Remark : Array cant store null value.