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.
ERRATA - Page 358 Kindle OCP Java 11 Part 1 ... Hanumant Deshmukh
Moderator: admin
-
- Posts: 3
- Joined: Sat Nov 23, 2019 11:04 am
- Contact:
-
- 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
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!
Added to the Errata.
thank you for your feedback!
Who is online
Users browsing this forum: No registered users and 10 guests