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.
Stay hungry stay foolish