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: 10061
- 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!
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: Google [Bot] and 99 guests