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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
vdomanico
Posts: 3
Joined: Sat Nov 23, 2019 11:04 am
Contact:

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

Post 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.

admin
Site Admin
Posts: 10385
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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!

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests