Page 1 of 1

ERRATA - Page 358 Kindle OCP Java 11 Part 1 ... Hanumant Deshmukh

Posted: Sat Nov 23, 2019 11:23 am
by vdomanico
Page 358, The RemoveIf method.

The book says that the example prints [1, 3, 5].
But the list created is unmodifiable/immutable (List.of(...)), so instead UnsupportedOperationException is thrown.

Re: ERRATA - Page 358 Kindle OCP Java 11 Part 1 ... Hanumant Deshmukh

Posted: Sat Nov 23, 2019 11:35 am
by admin
You are right, it should be List<Integer> iList = new ArrayList<>(List.of(1, 2, 3, 4, 5, 6));
Added to the Errata.
thank you for your feedback!