Skip to main content

Can you improve the list mutating operations code

Pl review the code snippet below and suggest any improvements

private static List<Integer> l;
private static void removeQ() {
    l = new ArrayList<>();
    IntStream.range(0, 100).forEach((i) -> l.add(i));
    l.remove(10);
}

You can find the answer here.

Comments